From c0a9840a66f8a500a4890e1457c1dfe9fdb409de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Feb 2004 17:14:26 +0000 Subject: [PATCH] =?UTF-8?q?Utilise=20un=20espace=20ins=E9cable=20comme=20s?= =?UTF-8?q?=E9parateur=20de=20milliers=20dans=20la=20fonction=20price=20af?= =?UTF-8?q?in=20de=20ne=20pas=20avoir=20de=20retour=20=E0=20la=20ligne=20a?= =?UTF-8?q?u=20milieu=20d'un=20montant.=20Cela=20=E9vite=20des=20affichage?= =?UTF-8?q?s=20incorrects=20ou=20coup=E9=20sur=20une=20page=20web,=20du=20?= =?UTF-8?q?montant.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/lib/functions.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 1cf967cc5d5..0d3b7321551 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -804,13 +804,15 @@ function print_duree_select($prefix) print "\n"; } +/* + * Return an amount with format "9 999.99" + */ function price($amount) { - return number_format($amount, 2, '.', ' '); - //return sprintf("%.2f", $amount); + $dec='.'; $thousand=' '; + return ereg_replace(' ',' ',number_format($amount, 2, $dec, $thousand)); } - function francs($euros) { return price($euros * 6.55957);