Hello all,
i have a variable $OrderTotal and it contains e.g. 120.00 i need to get it to contain 12000 basically converting it from a decimal into cents so that i can pass it to the payment gateway.
if anyone knows the code that will remove the decimal point i would greatly apreciate it
regards, Chris
are they always two decimals?
$a = 12.00; $b = ($a *100); then you should be able to convert it from a float to an integer with: $c = (int) ($b );
You may or may not need that last step...
thank you
i am so brain dead today i just could not think
and the answer is so easy
Embarrassing!!!
It's no problem....we all have been there!