mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
LibJS: Compute NumberFormat's rounding priority during construction
This is an editorial change in the ECMA-402 spec. See:
c28118e
This commit is contained in:
parent
bc8c2b2bc2
commit
b0c8543b28
4 changed files with 53 additions and 30 deletions
|
@ -171,6 +171,20 @@ StringView NumberFormatBase::rounding_type_string() const
|
|||
}
|
||||
}
|
||||
|
||||
StringView NumberFormatBase::computed_rounding_priority_string() const
|
||||
{
|
||||
switch (m_computed_rounding_priority) {
|
||||
case ComputedRoundingPriority::Auto:
|
||||
return "auto"sv;
|
||||
case ComputedRoundingPriority::MorePrecision:
|
||||
return "morePrecision"sv;
|
||||
case ComputedRoundingPriority::LessPrecision:
|
||||
return "lessPrecision"sv;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
StringView NumberFormatBase::rounding_mode_string() const
|
||||
{
|
||||
switch (m_rounding_mode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue