From 71c4c21cfe106c3078676a383feade34b1ba3386 Mon Sep 17 00:00:00 2001 From: Damien Seguy Date: Mon, 7 May 2001 09:13:26 +0000 Subject: [PATCH] Added example with number_format. Any other useful format may be added... git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@46794 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/math.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/functions/math.xml b/functions/math.xml index 161f94a302..563108eafe 100644 --- a/functions/math.xml +++ b/functions/math.xml @@ -842,6 +842,24 @@ $randval = mt_rand(); the decimals and thousands_sep instead of a comma (",") between every group of thousands. + + For instance, French notation usually use two decimals, + comma (',') as decimal separator, and space (' ') as + thousand separator. This is achieved with this line : + + +<?php + $nombre = 1234.56; + // english notation (default) + $english_format_number = number_format($nombre); + // 1,234.56 + // French notation + $nombre_format_francais = number_format($nombre, 2, ',', ' '); + // 1 234,56 +?> + + +