changing epsilon float to 0.01

This commit is contained in:
Edmond Teh
2020-09-29 12:53:04 +08:00
parent 3b53ea1b99
commit f27b40e4ab
+3 -3
View File
@@ -100,7 +100,7 @@ class InvoiceController extends Controller
$billing_charges = $booking->billing_charge;
$total = $subtotal + $adjustment + $billing_charges;
if (abs($total-$booking->bia) < PHP_FLOAT_EPSILON) {
if (abs($total-$booking->bia) > 0.01) {
return response()->json([
'message' => 'Booking amount expected is '.$booking->bia.'. Your Invoice amount is '.$total
], 400);
@@ -227,9 +227,9 @@ class InvoiceController extends Controller
$billing_charges = $booking->billing_charge;
$total = $subtotal + $adjustment + $billing_charges;
if (abs($total-$booking->bia) < PHP_FLOAT_EPSILON) {
if (abs($total-$booking->bia) > 0.01) {
return response()->json([
'message' => 'Booking amount expected is '.$booking->bia.'. Your Invoice amount is '.$total
'message' => 'Booking amount expected is '.gettype($booking->bia).'. Your Invoice amount is '.gettype($total)
], 400);
}