1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:58:12 +00:00

LibJS+LibUnicode: Rename method to select a NumberFormat plurality

Instead of currency pattern lookups within select_currency_unit_pattern,
rename the method to select_pattern_with_plurality and accept any list
of patterns. This method will be needed for units.
This commit is contained in:
Timothy Flynn 2021-11-16 09:45:27 -05:00 committed by Linus Groh
parent fa13ab61e4
commit 6d34a0b4e8
3 changed files with 5 additions and 5 deletions

View file

@ -1370,7 +1370,9 @@ Optional<Variant<StringView, String>> get_number_format_pattern(NumberFormat& nu
// Handling of other [[CurrencyDisplay]] options will occur after [[SignDisplay]].
if (number_format.currency_display() == NumberFormat::CurrencyDisplay::Name) {
auto maybe_patterns = Unicode::select_currency_unit_pattern(number_format.data_locale(), number_format.numbering_system(), number);
auto formats = Unicode::get_compact_number_system_formats(number_format.data_locale(), number_format.numbering_system(), Unicode::CompactNumberFormatType::CurrencyUnit);
auto maybe_patterns = Unicode::select_pattern_with_plurality(formats, number);
if (maybe_patterns.has_value()) {
patterns = maybe_patterns.release_value();
break;