You are here: Re: Setting the decimal point in php « PHP Programming Language « IT news, forums, messages
Re: Setting the decimal point in php

Posted by Andy Jeffries on 10/21/05 13:22

gayle wrote:
> Thanks Micha,
> I saw that, but it does not quite fit the script. It seems to require
> already knowing the number. I also tried echo round (',',2); but no
> good. I guess people would need to see the script for it to make any
> sense. Too many unique variables.

Your call to round doesn't make sense, you can't round a string to two
decimal places.

Do you mean you want to format a number with , at the thousand point and
two decimal places?

If so do:

echo number_format("1203.120321", 2);

Cheers,


Andy

 

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

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