Page 1 of 1

hopefully simple data type question.

Posted: Tue Jun 29, 2010 7:04 am
by aravona
Ok this is bugging me and I think its probably the easiest thing in the world to answer.

I have a database which uses floats for prices, because it needs decimals > however with phpmyadmin it doesnt keep .00 or .10 the latter becoming .1 however this doesnt look good at all. The prices were originally varchars but that made the prices not order properly.

Anyone know how I get the .00 back?

Thanks

Aravona

Re: hopefully simple data type question.

Posted: Tue Jun 29, 2010 9:23 pm
by JakeJ
You don't store .00 or .10 or whatever.

When displaying your data just use number_format($num, 2)