PHP - How to add decimals , . to my number without adding 00? -


i have prices in db , want add . , , display them on site.

i know number_format if use number_format($ctotal, 2, ".", ",");

it add 2 additional 00 @ end.

example:

db: 100000 now: 100,000.00 should this: 1,000.00 

looks easy task can't find solution ...

thanks!

you're better off storing numbers in format preferable math in database without floating-point issues, formatting numbers @ time of display. allow use source data calculations without needing reformat numbers (again) or encountering other problems floating-point calculations.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -