Jump to content

[SOLVED] Showing Decimals


Stoty

Recommended Posts

Hi there,

This might be a newbie questions, but was wondering how I can display the decimals on ALL numbers, not just ones with the decimal place being higher than '0' (eg 12.0)?

 

I have a field in my database named "Total". Its set to FLOAT(3,1).

 

In the table the values appear correctly, but when I display the info on a page they lose the decimal place unless the decimal is over "0".

 

Example:

 

In the DB    On the page

12.0          12

17.0          17

26.0          26

 

etc.

 

I want the values to display "12.0", "17.0", "26.0" on the page as well.

 

How can I go about doing this?

 

Thanks for any help.

 

 

Link to comment
https://forums.phpfreaks.com/topic/89761-solved-showing-decimals/
Share on other sites

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.