1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:57:34 +00:00

LibJS: Consistently use spaces / parentheses in NumberFormat operations

These are editorial changes in the ECMA-402 spec. See:
1508825
760f23a
This commit is contained in:
Timothy Flynn 2023-01-12 10:45:57 -05:00 committed by Linus Groh
parent 0ffad2a2d1
commit 0ff4d8100f

View file

@ -1083,7 +1083,7 @@ RawFormatResult to_raw_precision(MathematicalValue const& number, int min_precis
result.formatted_string = n.to_deprecated_string();
}
// 4. If e ≥ p1, then
// 4. If e ≥ (p 1), then
if (exponent >= (precision - 1)) {
// a. Set m to the string-concatenation of m and e - p + 1 occurrences of the code unit 0x0030 (DIGIT ZERO).
result.formatted_string = DeprecatedString::formatted(
@ -1514,7 +1514,7 @@ int compute_exponent(NumberFormat& number_format, MathematicalValue number)
// 8. Let newMagnitude be the base 10 logarithm of formatNumberResult.[[RoundedNumber]] rounded down to the nearest integer.
int new_magnitude = format_number_result.rounded_number.logarithmic_floor();
// 9. If newMagnitude is magnitude exponent, then
// 9. If newMagnitude is magnitude - exponent, then
if (new_magnitude == magnitude - exponent) {
// a. Return exponent.
return exponent;