Hi There.

Try this

//To get a comma rather that a period:

$fTotalPrice = $iQuantity * $fUnitPrice;
$fTotalPrice = str_replace( '.', ',', $fTotalPrice );

//To check wether to add a zero to the end of a float:

// Get part of float after comma.
$iDecimal = substr( $fTotalPrice, strpos( $fTotalPrice, ',' ) +1 );
if ( strlen( $iDecimal ) == 1 )
{
	$fTotalPrice .= '0';
}

I haven't tested this, but it should work.

Cheers

Scott

On 2003/01/09 12:44, Wilbert Enserink wrote:
Hi all,



I'm busy making a swebstore. I have troubles with the format of money.

I wanrt to display amounts like "2 products a ? 6,25 = ? 12,50"


Whatever I try I can't get the comma there (it's showing a point "." and it doesn't display the second number behind the comma i.e. "12.5"

Anybody knows how to make me my money? :-)

regards Wilbert




-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--
Scott Houseman
Senior Software Developer
Junk Mail Publishing (Pty) Ltd
T + 27 12 342 3840 ext 2806 F +27 12 342 3876
E [EMAIL PROTECTED] | www.junkmail.co.za
A 1312 Pretorius Street, Hatfield, Pretoria
P O Box 6574, Pretoria, 0001, South Africa
+27 82 491 8021


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to