You are here: Re: decimal formatting « All PHP « IT news, forums, messages
Re: decimal formatting

Posted by Koncept on 09/12/06 00:49

In article <ee49ue0d0o@drn.newsguy.com>, Tim <tim@aol.net> wrote:

> You could use printf|sprintf and assign it to whatever variable you needed it
> for. As an example, maybe...
>
> $rounded_no = sprintf("%.2f", $fp_no);

Yep. sprintf is what you are looking for. It returns a formatted value
but does not print like printf. Tim's example will work just fine for
you.

--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация