any value to 0000.00
Posted: Fri Mar 16, 2007 10:09 am
sorry for jumping right in with a question but this is really annoying me... ive been everywhere looking for the answer to this..
im building a shopping cart but the only money value the ecommerce company will accept is in the form of 0000.00
for example
$100 would be 0100.00
$100.35 would 0100.35
my problem is how do i make sure that the value i send to the ecommerce company is always in the correct format
what if i get a value of $1.20 or something?
how do i make 1.20 into 0001.20
how can i check the string for the right format and add the zeros where and when necesary?
please help
ive looked at http://uk2.php.net/manual/en/function.number-format.php
and
http://nl2.php.net/manual/nl/function.money-format.php
but all both seem to do is move the decimal point.
am i missing something?
im building a shopping cart but the only money value the ecommerce company will accept is in the form of 0000.00
for example
$100 would be 0100.00
$100.35 would 0100.35
my problem is how do i make sure that the value i send to the ecommerce company is always in the correct format
what if i get a value of $1.20 or something?
how do i make 1.20 into 0001.20
how can i check the string for the right format and add the zeros where and when necesary?
please help
ive looked at http://uk2.php.net/manual/en/function.number-format.php
and
http://nl2.php.net/manual/nl/function.money-format.php
but all both seem to do is move the decimal point.
am i missing something?