1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

LibJS+LibLocale: Port Intl.NumberFormat to String

This commit is contained in:
Timothy Flynn 2023-01-22 11:55:26 -05:00 committed by Tim Flynn
parent 76fd5f2756
commit 0c2efa285a
13 changed files with 169 additions and 149 deletions

View file

@ -448,7 +448,7 @@ ThrowCompletionOr<Vector<PatternPartition>> partition_duration_format_pattern(VM
auto number = MUST_OR_THROW_OOM(format_numeric(vm, *number_format, MathematicalValue(value)));
// 5. Append the new Record { [[Type]]: unit, [[Value]]: num} to the end of result.
result.append({ unit, TRY_OR_THROW_OOM(vm, String::from_deprecated_string(number)) });
result.append({ unit, move(number) });
// 6. If unit is "hours" or "minutes", then
if (unit.is_one_of("hours"sv, "minutes"sv)) {