Re: [PHP-DB] number formatting bug?

2001-02-21 Thread Lennin Arriola
I was thinking again , if you are for instance using winxxx check in start settings/control panel/regional settings decimal after point... this might be affecting, there must be something similar on unix. Check out in the help "set_locale" that should do the trick. Lennin Arriola [EMAIL PROTECT

Re: [PHP-DB] number formatting

2001-02-14 Thread Valerio Ferrucci
This is not what I want. I want only remove the right zeros, that is: $a = 2.1; number_format($a, 2, ",", "."); // 2,10 I want to display 2,1 $a = 2.00; number_format($a, 2, ",", "."); // 2,00 I want to display 2 $a = 2.46; number_format($a, 2, ",", "."); // 2,46 this is ok I want to display 2,4

RE: [PHP-DB] number formatting

2001-02-14 Thread Ben Cairns
Say, you get the result into a variable called $foo You could use: floor($foo); this would round it DOWN to a whole number: EG 2.1 returns 2 2.9 returns 2 -- Ben Cairns - Head Of Technical Operations intasept.COM Tel: 01332 365333 Fax: 01332 346010 E-Mail: [EMAIL PROTECTED] Web: http://www.intase

Re: [PHP-DB] number formatting

2001-02-14 Thread Valerio Ferrucci
Thanks, and if I say 2 decimals, the function returns 2,00 how to cut the final zeros (and also the ',' if last char), to obtain 2? Or num: 2.450 -> 2,45 (also if I said 4 decimals) Thanks Ben Cairns wrote: > This should tell what you need to know: > http://www.php.net/manual/en/function.numb

Re: [PHP-DB] number formatting

2001-02-14 Thread Valerio Ferrucci
Hi, I have a problem with numer formatting. I want to have string from my numbers that have thousands separator '.', decimal separator ',' and fixed n decimal digit. example: num: 1285.3string 1.285,3 num: 12.1string 12,10 etc. Is there some php function to do this? Thanks =