I am working on a payment gateway and the amount parameter needs to formatted this way:amount – (digits only) the integer value of the transaction in lowest common denomination (ex. $5.20 is 520)
I have already removed the $
and all values will be rounded to 2 decimal places.
In PHP if i try to cast amount as int
ie (int)$amount
I am going to loose the .20 in the example though its needed. What could be the best way to go about this?