Now it is compatible with every locale

This commit is contained in:
pezcurrel 2023-12-28 12:25:43 +01:00
parent 52621c608e
commit d0dfd42001

View file

@ -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']);
} }
?> ?>