Opened 15 months ago

#18542 new bug

BStringFormat() and string_for_size() should respect locale formatting

Reported by: humdinger Owned by: pulkomandy
Priority: normal Milestone: Unscheduled
Component: Kits/Locale Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This is hrev57177, 64bit.

The Locale prefs provide a setting for the language and the formatting. BStringFormat() seems to only respect the 'language' setting, and not the 'formatting'. string_for_size() not even that...

My setting is language: English, formatting: German.

Attached is a little test app that prints some infos.

Here is the output for my setting:

❯ locale -lf
en
de_DE.UTF-8

❯ CLIapp
BNumberFormat separators: decimal: ,    1000: .

string_for_size: 1.00 KiB
BStringFormat: (1,024 bytes)

The separators are correct (German is the opposite to English).

string_for_size should be "1,00 KiB"
BStringFormat should (1.024 bytes)

If I change my 'language' setting to German, the output of BStringFormat() correct; string_for_size() is still not correct:

❯ locale -lf
de
de_DE.UTF-8 
❯ CLIapp
BNumberFormat separators: decimal: ,    1000: .

string_for_size: 1.00 KiB
BStringFormat: (1.024 bytes)

Attachments (1)

App.cpp (863 bytes ) - added by humdinger 15 months ago.

Download all attachments as: .zip

Change History (1)

by humdinger, 15 months ago

Attachment: App.cpp added
Note: See TracTickets for help on using tickets.