Recent

Author Topic: Format with thousands separator  (Read 12696 times)

tintinux

  • Sr. Member
  • ****
  • Posts: 311
    • Gestinux
Re: Format with thousands separator
« Reply #15 on: September 17, 2015, 10:10:27 am »
Hi otoien

Since you have a FPC 3.0, can you read and try the second solution proposed by Bart Broesma (use the "Set Utf-8 in RTL" option in Project Options) in my bug report ?  I do not  understand why, but may be he will explain...

By the way, I don't think a string is needed in ThousandSeparator, a double-byte char would do the job (with a "thin space" too).

Regards

Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

otoien

  • Jr. Member
  • **
  • Posts: 87
Re: Format with thousands separator
« Reply #16 on: September 18, 2015, 02:40:36 am »
Of course I have "Set Utf-8 in RTL" active through the compiler directive, that is the reason why I use the fixes branch with fpc 3.01 right now. FormatSettings.ThousandSeparator type is char that only takes one byte, so it is impossible to set it to a multi-byte value required for the UTF-8 version of thin space. I am not aware of any other type than string that can hold a multibyte-byte UTF-8 code point?  [There is widechar, but I do not think it is intended for UTF-8, as it is fixed at two bytes; UTF8 may require more than 2 bytes].
Unless otherwise noted I always use the latest stable version of Lasarus/FPC x86_64-win64-win32/win64

tintinux

  • Sr. Member
  • ****
  • Posts: 311
    • Gestinux
Re: Format with thousands separator
« Reply #17 on: September 18, 2015, 08:53:57 am »
Hi

http://wiki.lazarus.freepascal.org/FPC_Unicode_support#PWideChar.2FPUnicodeChar_and_WideChar.2FUnicodeChar

We need the {$mode delphiunicode} directive, to put UTF8 or other multibyte characters in a type Char, and it is not required AFAIK for strings.

Maybe the directive could solve the issue ?  I can't try before a few days, let us know if you did.

Yes, your suggestion to declare Thousand separator use a string may work too, without requesting the directive, but I don't know if this will be changed in FPC.

Regards

Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

 

TinyPortal © 2005-2018