On Dec 19, 2011, at 11:38 AM, Robert Cummings wrote:
> On 11-12-19 11:08 AM, Bastien Koert wrote:
>> On Mon, Dec 19, 2011 at 9:19 AM, Floyd Resler wrote:
>>> In the previous version of PHP we were using, I could pass a string to
>>> number_format and it would just change it to a 0 without compl
On 11-12-19 11:08 AM, Bastien Koert wrote:
On Mon, Dec 19, 2011 at 9:19 AM, Floyd Resler wrote:
In the previous version of PHP we were using, I could pass a string to number_format and
it would just change it to a 0 without complaint. With 5.3.6 I get an "expects
double" error. I don't supp
Quoting Floyd Resler :
In the previous version of PHP we were using, I could pass a string
to number_format and it would just change it to a 0 without
complaint. With 5.3.6 I get an "expects double" error. I don't
suppose there's a way to make it work like it used to??? I'm
dealing wit
On Mon, Dec 19, 2011 at 9:19 AM, Floyd Resler wrote:
> In the previous version of PHP we were using, I could pass a string to
> number_format and it would just change it to a 0 without complaint. With
> 5.3.6 I get an "expects double" error. I don't suppose there's a way to make
> it work lik
In the previous version of PHP we were using, I could pass a string to
number_format and it would just change it to a 0 without complaint. With 5.3.6
I get an "expects double" error. I don't suppose there's a way to make it work
like it used to??? I'm dealing with really old code that wasn't
I´m sorry.
My head´s crazy todar.
Thanks a lot.
"Stut" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> João Cândido de Souza Neto wrote:
>> If you look at carefuly, you´ll see that i´ve two problems in the same
>> function.
>>
>> 1 - This function add blank spaces at th
João Cândido de Souza Neto wrote:
If you look at carefuly, you´ll see that i´ve two problems in the same
function.
1 - This function add blank spaces at the beginning of the string.
2 - This function rounds the $var value and it can causes meny troubles.
Ok, I've already checked that number_f
João Cândido de Souza Neto wrote:
I´m having some troubles with the number_format function.
When i run a number_format("3000",2,",",".") if returns correctly, but when
i try to run number_format("300",2,",",".") it returns the value formatted
but with two spaces before.
Anyone knows how can
Hi.
I´m using the number_format function to format my currency numbers.
i.g.: number_format($var,2,",",".")
Anyone´ll knew to tell me if this function rounds the number according of
decimals?
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.n
Hi.
I´m having some troubles with the number_format function.
When i run a number_format("3000",2,",",".") if returns correctly, but when
i try to run number_format("300",2,",",".") it returns the value formatted
but with two spaces before.
Anyone knows how can i avoid this?
Thanks.
--
PH
: <[EMAIL PROTECTED]>
To: "Jay Blanchard" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 2:36 PM
Subject: RE: [PHP] number_format question
>
> Tried it. It works but crops everything after the first "," in the number
> if you
> Tried it. It works but crops everything after the first "," in the
number
> if you enter a number with commas. Works great if you don't enter any
> commas.
How many integers can you name that have commas in them??? In other
words, you have a string, so PHP converts it to an integer to pass to
n
what about str_replace(",", "", $str) before you pass the value to
number_format()?
-Original Message-
From: [EMAIL PROTECTED] [mailto:ed@;home.homes2see.com]
Sent: Friday, November 01, 2002 9:37 AM
To: Jay Blanchard
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] nu
Tried it. It works but crops everything after the first "," in the number
if you enter a number with commas. Works great if you don't enter any
commas.
What I need to be able to do:
IN OUT
123456789 > 123,456,789
123456789.00 > 123,456,789
123,456,789.00 > 123,456,789
[snip]
If I try that I get a wrong parameter count error.
[/snip]
number_format ( float number [, int decimals [, string dec_point [, string
thousands_sep]]])
number_format($number, 0, '', ',');
Try that ...
Jay
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
If I try that I get a wrong parameter count error.
Ed
On Thu, 31 Oct 2002, Jay Blanchard wrote:
> [snip]
> I using number_format where I need to turn a number say "123456789" into
> "123,456,789" and it works just fine. I also need it to strip the decimal
> out if someone enters it. I.E "123
[snip]
I using number_format where I need to turn a number say "123456789" into
"123,456,789" and it works just fine. I also need it to strip the decimal
out if someone enters it. I.E "123456.00" would become "123,456"
the command I'm using right now is:
number_format($number, ",");
If I enter "
I using number_format where I need to turn a number say "123456789" into
"123,456,789" and it works just fine. I also need it to strip the decimal
out if someone enters it. I.E "123456.00" would become "123,456"
the command I'm using right now is:
number_format($number, ",");
If I enter "123456
Look into printf and sprintf.
--- "Scott St. John" <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I am trying to format a number for a report, the one
> consistant thing is
> the three decimal places. But I need to strip them,
> then fill in zero's
> from the left.
>
> So, if the number c
tair Battrick
> Senior Developer
> Lightwood Consultancy Ltd
> http://www.lightwood.net
>
> > -Original Message-
> > From: Scott St. John [mailto:[EMAIL PROTECTED]]
> > Sent: 08 March 2002 17:02
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] number_format
17:02
> To: [EMAIL PROTECTED]
> Subject: [PHP] number_format
>
>
> Hi everyone,
>
> I am trying to format a number for a report, the one consistant thing is
> the three decimal places. But I need to strip them, then fill in zero's
> from the left.
>
> So, if the num
Hi everyone,
I am trying to format a number for a report, the one consistant thing is
the three decimal places. But I need to strip them, then fill in zero's
from the left.
So, if the number coming in is 8.000 I need to convert to 00800, 11.070
would convert to 01107.
I have tried a combi
"Jeff Oien" <[EMAIL PROTECTED]> wrote:
> I have a number like this 0.51 and I would like it to display without
> the leading 0. How can I do this? Thanks.
There are lots of solutions.
$num = 0.51;
$num_parts = explode( '.', $num );
$num_new = '.' . $num_parts[1];
Or if it's always going to be
I have a number like this 0.51 and I would like it to display without
the leading 0. How can I do this? Thanks.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrat
> I'm finding some problems on using number_format($value, $decimal, ",",
> ".") when I have a value comming from a resultset (database query
> results)...
> If I had something like '123.45', using number_format it will return
> '123,00'.
> I think this happens because my value is a string and PHP
Hi,
I'm finding some problems on using number_format($value, $decimal, ",",
".") when I have a value comming from a resultset (database query
results)...
If I had something like '123.45', using number_format it will return
'123,00'.
I think this happens because my value is
26 matches
Mail list logo