Jump to content

Displaying decimal precision


lmhart

Recommended Posts

I am having issues echoing decimal precision.  It stores in the DB just fine.  Just when I go to display the data it will cut off a trailing 0.  So 10.80 ends up echoing 10.8.

 

Is there a relatively easy way to set the precision? If not I can live with it.  Its just a cosmetic thing

 

My code to display

echo "Amount due - " . $total;
echo "<br>";

 

Thanks,

Mark

Link to comment
https://forums.phpfreaks.com/topic/180443-displaying-decimal-precision/
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.