[Gambas-user] Format$ thousand separator

Epíleg epileg at ...626...
Wed Dec 19 16:59:18 CET 2007


En/na Benoit Minisini ha escrit:
> On mercredi 19 décembre 2007, Benoit Minisini wrote:
>> On mercredi 19 décembre 2007, Epíleg wrote:
>>> Hello,
>>>
>>> I do not get the thousand separator whit the «format$» function, some
>>> examples:
>>>
>>>
>>> PRINT Format$(1000000, "$$,#.00")  =>  EUR 1 000 000,00
>>>
>>> PRINT Format$(1000000, "$,#.00")  =>  € 1 000 000,00
>>>
>>> PRINT Format$(1000000, ",#.00")  =>  1000000,00
>>>
>>>
>>> What I'm doing wrong?
>>>
>>> These tests are done in a Ubuntu Gutsy (7.10) with «ca_ES.UTF-8» locale
>>>
>>> Regards,
>>> Epíleg.
>> Apparently, this is a bug!
> 
> The last revision now takes thousand separators into account. 
> 
> But be careful that in the GNU locales, many languages have thousand 
> separators only for currencies.
> 
> So, when a locale does not have any thousands separator, a space is used, and 
> the value is splitted each three digits. Maybe this is a bad idea that will 
> be removed in the future!
> 
> Regards,
> 

Thanks!

In an Ubuntu 7.10 with locale en_US.UTF-8 and en_GB.UTF-8, the thousand separator works fine also with numbers, but with locale ca_ES.UTF-8 and es_ES.UTF-8 do not works with numbers (spaces added). In both cases the currencies thousand separator works fine.

Excuse my ignorance but in an Open Office Spread document, format function works correctly with numbers and currencies in all of above locale and I don't know why.

Thanks a lot,
Epíleg.





More information about the User mailing list