Forum Moderators: coopster

Message Too Old, No Replies

Monetary Decimal Places

Setting 2 decimal places

         

geo039

9:27 pm on Mar 23, 2006 (gmt 0)

10+ Year Member



I have written a simple script to display data in a database, the problem is the price is displaying as 11, 8 and 14 when the database it is 11.50, 8.50 and 14.00. Am I supposed to add a script to show 2 decimal monetary values using PHP. If so what is the script? I just assumed the data from the database displayed as is?

Thanks

tomda

6:11 am on Mar 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't need a script since they is an already-made fuinction in PHP call number_format().
Do some search for "number_format php".