Jump to content

Format number question


182x

Recommended Posts

If you're using mysql, you can change the data type of the column in the database to decimal(M,D) where M is the total number of digits and D the number of digits after the decimal point.

As mjdamato said you can just format the number after it's been pulled from the database using number_format()
Nice one thanks guys for the syntax of number_format() when dealing with session variables I have to leave off the quotes is the following correct:

[code]
echo number_format($HTTP_SESSION_VARS['curr'],2)
[/code]

or should it be:

[code]
echo number_format("$HTTP_SESSION_VARS['curr']",2)
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.