Udders Udders - 1 year ago 96
PHP Question

price help turn pounds into pence

I am working with codeigniter and i need to change 2.50 into 250 or 300.70 into 30070, basically, I need send PAYPAL my price in pence and not pounds, how do I change it so my price reads in pence and not pounds?

Answer Source

The following code will convert pounds to pence:

$pence = $pounds * 100;

It really is that simple. Google will confirm it. It's analogous to converting dollars to pennies.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download