TED]>; PHP General
|<[EMAIL PROTECTED]>
|Sent: Tuesday, November 26, 2002 2:36 PM
|Subject: RE: [PHP] decimal places
|
|
|
|$amount = 17.9;
|$dollars = "$" . number_format($amount, 2);
|echo "$dollars";
|
|you should see $17.90.
|Robbert van Andel
|
|
|-Original Message---
- Original Message -
From: Van Andel, Robert <[EMAIL PROTECTED]>
To: Bryan Koschmann - GKT <[EMAIL PROTECTED]>; PHP General
<[EMAIL PROTECTED]>
Sent: Tuesday, November 26, 2002 2:36 PM
Subject: RE: [PHP] decimal places
$amount = 17.9;
$dollars = "$" . number
$amount = 17.9;
$dollars = "$" . number_format($amount, 2);
echo "$dollars";
you should see $17.90.
Robbert van Andel
-Original Message-
From: Bryan Koschmann - GKT [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 11:29 AM
To: PHP General
Subject:
Try.. printf("%.2f", $amount);
-Kevin
- Original Message -
From: "Bryan Koschmann - GKT" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Tuesday, November 26, 2002 12:29 PM
Subject: [PHP] decimal places
> Hello,
>
> D
Hello,
Does anyone here have a good way to make sure dollar amounts are formatted
properly? I have something that returns data, but the problem is it's
stored where any trailing zero isn't kept, like this:
$16.95 or $172.82 are fine
$17.90 or $190.20 come back as $17.9 and $190.2
I would like t
Fields("UnitPrice"), 2, -2, -2) ?>
-Original Message-
From: Andrew Wilson <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, October 29, 2002 11:34 PM
Subject: [PHP] Decimal Places
>Hay guys,
>I have two variables ( integers )
have a look at number_format()
-Original Message-
From: Andrew Wilson [mailto:will@;netwaynetworks.com.au]
Sent: Wednesday, October 30, 2002 3:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Decimal Places
Hay guys,
I have two variables ( integers ) that are being minused one from the other
Hay guys,
I have two variables ( integers ) that are being minused one from the other
and i am printing the result to the screen but i am getting unwanted
decimals.
print ($eall - $sall) / 1000;
My question is what is the easiest way to strip decimals off the above
result. The only way i know a
8 matches
Mail list logo