Jump to content

Archived

This topic is now archived and is closed to further replies.

Mateobus

Type cast a number to 3 digit float

Recommended Posts

Um, what about 37  do you want 37.00 or 37.0  ???

Do you mean signifigant figures?

How about .00002323  do you want .000  or do you want .0000232

round()

provides some functionality you might find useful.

Jeff

Share this post


Link to post
Share on other sites
[url=http://us2.php.net/manual/en/function.number-format.php]number_format()[/url] may also be of use.

Share this post


Link to post
Share on other sites
[quote author=Jenk link=topic=107590.msg431974#msg431974 date=1157964286]
[url=http://us2.php.net/manual/en/function.number-format.php]number_format()[/url] may also be of use.
[/quote]

that's probably your best bet since it returns a float with the exact precision you request.

Share this post


Link to post
Share on other sites

×

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.