Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Numbers Formater Decimal & Thousand Separator PHP

<?php

$number = 1234.56;

// english notation (default)
$english_format_number = number_format($number);
// 1,235

// French notation
$nombre_format_francais = number_format($number, 2, ',', ' '); 
//2 digits after decimal, decimal separator:',' and thousand separator: ' '
// 1 234,56

$number = 1234.5678;

// english notation without thousands separator
$english_format_number = number_format($number, 2, '.', '');
// 1234.57

?>
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #Numbers #Formater #Decimal #Thousand #Separator #PHP
ADD COMMENT
Topic
Name
7+1 =