Forum Moderators: coopster

Message Too Old, No Replies

forcing round() to add trailing 0's

         

dmmh

11:21 am on Feb 21, 2005 (gmt 0)

10+ Year Member



I'm using a webservice to query for currency conversion rates and this returns me a value which I use round() on like round($string, 2) to force two chars behind the comma, but it doesnt output a trailing zero if there is one

eg, it will return 124,1 instead of 124,10

how can I bypass this?

dcrombie

12:57 pm on Feb 21, 2005 (gmt 0)



number_format [php.net]

;)

dmmh

1:37 pm on Feb 21, 2005 (gmt 0)

10+ Year Member



ic, thx :)