Ask a Question related to PHP Development, Design and Development.
-
Phpu #1
divide
Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. For example:
$number1=10000000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764....
And I wanna the result to be like this 588,235
thanks
Phpu Guest
-
Divide 24h into parts
Hello, I'm creating a small web application for my company, but I can't find a good and reliable algorithm to create a function which divides... -
Divide by Zero in RDE
On Fri, Oct 10, 2003 at 01:15:13AM +0900, Johan Nilsson wrote: You mentioned a patch for another version. I have once upgraded RDE to a newer... -
Gap when using Divide
Hello, I was trying Freehand MX and noticed that when using the Divide command, appears a small gap between the newly created shapes... Is there a... -
Divide by Zero Error
Receive the folowing error when attempting to add a new "label" to an Access 2000 form (note: form has other controls and labels working correctly... -
[VCD] How can U divide into chapters'
I have a file ready to be burt as a 50mins VCD. But if I create a VCD with this file, then I will end up with one chapter lasting the whole... -
Phpu #2
Re: [PHP] divide
yes but if the result is a number like this 34056983 i wanna display this number like this 34,056,983
Please help me with this one
----- Original Message -----
From: Nathan Taylor
To: phpu
Sent: Wednesday, September 10, 2003 2:49 AM
Subject: Re: [PHP] divide
Check out number_format();
www.php.net/number_format
----- Original Message -----
From: phpu
To: php-general@lists.php.net
Sent: Tuesday, September 09, 2003 7:50 PM
Subject: [PHP] divide
Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. For example:
$number1=10000000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764....
And I wanna the result to be like this 588,235
thanks
Phpu Guest
-
Gabriel Guzman #3
Re: [PHP] divide
On Tuesday 09 September 2003 05:04 pm, phpu wrote:
> yes but if the result is a number like this 34056983 i wanna display this
> number like this 34,056,983 Please help me with this one
that's exactly what number_format() does... from the example on
[url]www.php.net/number_format[/url] :
<?php
$number = 1234.56;
// english notation (default)
$english_format_number = number_format($number);
// 1,234
// French notation
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,56
$number = 1234.5678;
// english notation without thousands seperator
$english_format_number = number_format($number, 2, '.', '');
// 1234.57
?>
that's all there is to it.
Gabriel Guzman Guest
-
Phpu #4
Re: [PHP] divide
Sorry
I've got it.
Thanks a lot
----- Original Message -----
From: Nathan Taylor
To: phpu
Sent: Wednesday, September 10, 2003 2:59 AM
Subject: Re: [PHP] divide
Check out number_format() like I said.
----- Original Message -----
From: phpu
To: Nathan Taylor
Cc: php-general@lists.php.net
Sent: Tuesday, September 09, 2003 8:04 PM
Subject: Re: [PHP] divide
yes but if the result is a number like this 34056983 i wanna display this number like this 34,056,983
Please help me with this one
----- Original Message -----
From: Nathan Taylor
To: phpu
Sent: Wednesday, September 10, 2003 2:49 AM
Subject: Re: [PHP] divide
Check out number_format();
www.php.net/number_format
----- Original Message -----
From: phpu
To: php-general@lists.php.net
Sent: Tuesday, September 09, 2003 7:50 PM
Subject: [PHP] divide
Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. For example:
$number1=10000000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764....
And I wanna the result to be like this 588,235
thanks
Phpu Guest
-
Cpt John W. Holmes #5
Re: [PHP] divide
From: "phpu" <phpu@go.ro>
comma. For example:> I'm new in php and i've got allready a problem.
> I wanna divide 2 numbers and the result to be an integer separated byI don't know if this is old or not, but I just got it.> $number1=10000000;
> $number2=17;
> $result=$number1 / $number2;
> In this case the result is 588235.29411764....
> And I wanna the result to be like this 588,235
Anyhow, use number_format()
---John Holmes...
Cpt John W. Holmes Guest



Reply With Quote

