Currently PHP function number_format is not multibyte safe, so if in lang/*-utf-8.inc.php $number_thousands_separator I would use non-breaking space (\xc2\xa0) for thousands separator, then it would print only \xc2.
These language now uses space, but should use non breaking space.
czech
finnish
french
georgian
hungarian
latvian
lithuanian
polish
russian
slovak
swedish
Patch
Logged In: YES
user_id=210714
Originator: NO
Thanks Edgaras. I have 2 questions:
1. In this part:
+ //number_format is not multibyte safe, str_replace is safe
if ($length === 0) {
- return number_format($value,
- $comma,
- $GLOBALS['number_decimal_separator'],
- $GLOBALS['number_thousands_separator']);
+ return str_replace(',', $GLOBALS['number_thousands_separator'], number_format($value));
why not using $GLOBALS['number_decimal_separator'] like you do here:
- $value = number_format($value,
- $comma,
- $GLOBALS['number_decimal_separator'],
- $GLOBALS['number_thousands_separator']);
+ //number_format is not multibyte safe, str_replace is safe
+ $value = str_replace(array(',', '.'),
+ array($GLOBALS['number_thousands_separator'], $GLOBALS['number_decimal_separator']),
+ number_format($value, $comma));
==========
2. Could you attach here an example of this non-breaking space as a patch for one of these languages?
Logged In: YES
user_id=1161712
Originator: YES
1. I thought that it's always integer when length=0, so it's never decimal part, but now I think you are right. Use
return str_replace(array(',', '.'),
array($GLOBALS['number_thousands_separator'], $GLOBALS['number_decimal_separator']),
number_format($value, $comma));
2. Here is patch for all languages where currently is space (Lithuanians also use ' ' and ',', so changed them also).
Logged In: YES
user_id=1161712
Originator: YES
File Added: nbsp.patch
Language files patch
Logged In: YES
user_id=210714
Originator: NO
Merged in subversion, thanks.