You are here: Re: percentages in PHP « PHP Programming Language « IT news, forums, messages
Re: percentages in PHP

Posted by Chris H on 04/05/06 12:32

i knew it was something simple liek that, damm brain farts... for some
reason my basic math skills escaped me and i forgot how to convert the %
into a usable number by php.. i.e using decimal places... i didnt know about
the round() function though, yet another one of the many functions i have
yet to come across..

Anyway.. thanks michael for your quick reply


"Michael Pichler" <mail@michaelpichler.de> wrote in message
news:e102a4$pci$01$1@news.t-online.com...
> Chris H schrieb:
> [...]
>> in other words what is the correct format for this type of equation.
>>
>> $prize_pool = "5000";
>> $total_points = 70% of $prize_pool
>>
>
> I'm not sure if I understood your problem.
>
> <?
> $total_points = (int) $prize_pool * 0.7;
> // if needed
> $total_points = round($total_points);
> ?>
>
> Can it be that simple?
>
> Michael
>
>

 

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

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