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
|
||||
function fnum($num,$dec,&$lang) {
|
||||
if (is_null($num)) return(null);
|
||||
if ($lang=='en') return(number_format($num,$dec,'.',','));
|
||||
return(number_format($num,$dec,',','.'));
|
||||
/*
|
||||
$lc must be a variable that was set using the localeconv() function.
|
||||
The locale must be correctly set with setlocale to an actually available
|
||||
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