1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibUnicode: Generate primary and secondary number grouping sizes

Most locales have a single grouping size (the number of integer digits
to be written before inserting a grouping separator). However some have
a primary and secondary size. We parse the primary size as the size used
for the least significant integer digits, and the secondary size for the
most significant.
This commit is contained in:
Timothy Flynn 2021-11-13 22:03:22 -05:00 committed by Linus Groh
parent 0e5983e603
commit 3b7f5af042
4 changed files with 53 additions and 3 deletions

View file

@ -85,6 +85,11 @@ enum class Style : u8 {
Numeric,
};
struct NumberGroupings {
u8 primary_grouping_size { 0 };
u8 secondary_grouping_size { 0 };
};
enum class StandardNumberFormatType : u8 {
Decimal,
Currency,
@ -181,6 +186,7 @@ Optional<StringView> get_locale_script_mapping(StringView locale, StringView scr
Optional<StringView> get_locale_currency_mapping(StringView locale, StringView currency, Style style);
Vector<StringView> get_locale_key_mapping(StringView locale, StringView keyword);
Optional<StringView> get_number_system_symbol(StringView locale, StringView system, StringView symbol);
Optional<NumberGroupings> get_number_system_groupings(StringView locale, StringView system);
Optional<NumberFormat> get_standard_number_system_format(StringView locale, StringView system, StandardNumberFormatType type);
Vector<NumberFormat> get_compact_number_system_formats(StringView locale, StringView system, CompactNumberFormatType type);
Optional<ListPatterns> get_locale_list_patterns(StringView locale, StringView type, StringView style);