Jump to content

Re: help with float numbers in php


Grandioso

Recommended Posts

If you posted the question on the tail of another thread, it was probably split off by one of the other mods, or an admin. It'll get more visibility this way anyhow.

 

To answer your question, you can use number_format().

 

$float = 9646.15659;
echo number_format( $float, 2, '.', ',' );
//returns 9,646.16

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.