I have decimal numbers like this 0.00651536
and I am unable to validating this number to see if its greater than other decimal number (e.g: 0.00651537
) or not!
here is an example:
//$request->input('price') = 0.00651537
//$product->price = 0.00651536
if($request->input('price') > $product->price) {
// my input is greater than product price
} else {
// my input is not greater than product price
}
Issue: (Update)
As my $product->price
is decimal starting with 0.
it just keep looking to that 0
and does not validate rest of it while my input number difference with product price is in decimals.
How can I validate my numbers?
PS: These are just sample numbers therefore decimals could be shorter or longer (don't go with this example length)