You are here:  » Number Format

Support Forum



Number Format

Submitted by webie on Sun, 2008-02-17 09:19 in

Hi Dave

ignor my last post i found this on php.net still trying to find excution time for returned results
but i thought i share what i find just in case in might help other Price Tapestry users.

cheers all the best

Darren

<?php
// http://www.php.net/manual/en/function.number-format.php
$number $resultCount;
// english notation (default)
$english_format_number number_format($number);
// 1,235
// French notation
$nombre_format_francais number_format($number2','' ');
// 1 234,56
$number 1234.5678;
// english notation without thousands seperator
$english_format_number number_format($number2'.''');
// 1234.57
?>

I used it like this

<?php
 
print $english_format_number number_format($number); 
?>
Results for
<?php
 
print (isset($q)?$q:""); 
?>

Submitted by support on Sun, 2008-02-17 10:43

Thanks, Darren.

There's quite a lot of flexibility with number_format - i've suggested it a number of times in the forum!

Cheers,
David.