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

LibJS: Make PluralRules use the new double parser

This commit is contained in:
davidot 2022-10-12 02:23:09 +02:00 committed by Linus Groh
parent 7db59124e8
commit d66bfcc3f4

View file

@ -21,9 +21,7 @@ PluralRules::PluralRules(Object& prototype)
::Locale::PluralOperands get_operands(String const& string)
{
// 1.Let n be ! ToNumber(s).
char* end { nullptr };
auto number = strtod(string.characters(), &end);
VERIFY(!*end);
auto number = string.to_double(AK::TrimWhitespace::Yes).release_value();
// 2. Assert: n is finite.
VERIFY(isfinite(number));