You are here: Re: round function issue « PHP Programming Language « IT news, forums, messages
Re: round function issue

Posted by dkruger on 10/17/07 14:57

On Oct 17, 9:54 am, Krustov <m...@privacy.net> wrote:
> <comp.lang.php>
> <dkruger>
> <Wed, 17 Oct 2007 07:33:06 -0700>
> <1192631586.455946.270...@v29g2000prd.googlegroups.com>
>
> > I am having a little problem that I am hoping someone can help me out
> > with. In one of my scripts, I am working with some dollar values, and
> > using round to change the result calculated values into a dollar value
> > with cents etc...so I should be getting $200.43 instead of $200.42987
> > etc.
>
> > The command I am using is:
>
> > $total_revenue = round(($renew+$inc_new+$national_rec+$chargeback),2);
>
> > This had been working previously on the old server, but a few days
> > ago, I transferred everything to a new system, and now it is as though
> > the round command is ignoring the 2 for decimal places and instead
> > rounding up to the next dollar value.
>
> Never used round() butwww.php.net/manual/en/function.number-format.php
> might be worth a look .
>
> --www.vhit.co.ukwww.jpgimage.co.ukwww.phpwhois.co.ukwww.cannabiswindow.co.uk

Thanks, I did find that it is not actually caused by the round
function, but it seems a mysql problem, so will need to check it out
over there.

 

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

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