function locale_number_format($Number, $DecimalPlaces = 0) { global $DecimalPoint; global $ThousandsSeparator; if ($_SESSION['Language'] == 'hi_IN.utf8' or $_SESSION['Language'] == 'en_IN.utf8') { return indian_number_format($Number, $DecimalPlaces); } else { if (!is_numeric($DecimalPlaces) and $DecimalPlaces == 'Variable') { $DecimalPlaces = mb_strlen($Number) - mb_strlen(intval($Number)); if ($DecimalPlaces > 0) { $DecimalPlaces--; } } return number_format($Number, $DecimalPlaces, $DecimalPoint, $ThousandsSeparator); } }
function locale_number_format($Number, $DecimalPlaces = 0) { global $DecimalPoint; global $ThousandsSeparator; if (substr($_SESSION['Language'], 3, 2) == 'IN') { // If country is India (??_IN.utf8). See Indian Numbering System in Manual, Multilanguage, Technical Overview. return indian_number_format(floatval($Number), $DecimalPlaces); } else { if (!is_numeric($DecimalPlaces) and $DecimalPlaces == 'Variable') { $DecimalPlaces = mb_strlen($Number) - mb_strlen(intval($Number)); if ($DecimalPlaces > 0) { $DecimalPlaces--; } } return number_format(floatval($Number), $DecimalPlaces, $DecimalPoint, $ThousandsSeparator); } }