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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

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

Post 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
pbs
Forum Contributor
Posts: 230
Joined: Fri Nov 07, 2008 5:31 am
Location: Nashik, India
Contact:

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

Post by pbs »

multiply the number with 100
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

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

Post by jonnyfortis »

oh yes, thanks
Post Reply