Page 1 of 1

remove decimal out of an equation to send to a payment gatew

Posted: Mon May 20, 2013 5:53 am
by jonnyfortis
i have a value that currently has shows a decimal

Code: Select all

@$amount = $_POST['amount'];

i need the decimal to show until the variable $amount is sent to the payment gateway


what is the best way to remove the decimal from the variable

so a value of e.g

250.59

will be sent as 25059

thanks

Re: remove decimal out of an equation to send to a payment g

Posted: Mon May 20, 2013 6:01 am
by pbs
multiply the number with 100

Re: remove decimal out of an equation to send to a payment g

Posted: Mon May 20, 2013 7:47 am
by jonnyfortis
oh yes, thanks