Page 1 of 1

problem with small number format

Posted: Mon Nov 07, 2005 8:36 am
by 123newbiephp
hi,

I'm having trouble outputting a value of lets say 2599 as 25.99. Is there a function that does this for you?

I've looked at number_format(), but this is only useful for dividing a number into thousands, rather than into tens.

Any help is much appreciated.

Posted: Mon Nov 07, 2005 8:38 am
by Charles256
well if you divide any number by 100 it moves the decimal places two places to the left... :-D

Posted: Mon Nov 07, 2005 8:39 am
by feyd
if the number isn't in the proper format, number_format() isn't at fault.. divide the number by 100..

Posted: Mon Nov 07, 2005 10:34 am
by foobar
If you're working with integers as your input, run them through intval().