Now it is compatible with every locale
This commit is contained in:
parent
52621c608e
commit
d0dfd42001
1 changed files with 8 additions and 4 deletions
|
@ -1,7 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
function fnum($num,$dec,&$lang) {
|
/*
|
||||||
if (is_null($num)) return(null);
|
$lc must be a variable that was set using the localeconv() function.
|
||||||
if ($lang=='en') return(number_format($num,$dec,'.',','));
|
The locale must be correctly set with setlocale to an actually available
|
||||||
return(number_format($num,$dec,',','.'));
|
locale before using localeconv() and this function.
|
||||||
|
*/
|
||||||
|
function fnum($num,$lc,$dec=0) {
|
||||||
|
if (is_null($num)) return null;
|
||||||
|
return number_format($num,$dec,$lc['decimal_point'],$lc['thousands_sep']);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue