LibWeb: Serialize CSS::Number to spec

We were previously serializing with 5 instead of 6 digits of precision
This commit is contained in:
Callum Law 2025-11-05 12:48:23 +13:00 committed by Sam Atkins
parent 76108b1979
commit 8944130fde
Notes: github-actions[bot] 2025-12-01 11:02:13 +00:00

View file

@ -6,6 +6,7 @@
#include <AK/Math.h>
#include <LibWeb/CSS/Number.h>
#include <LibWeb/CSS/Serialize.h>
namespace Web::CSS {
@ -19,7 +20,7 @@ String Number::to_string(SerializationMode) const
return "-infinity"_string;
if (isnan(m_value))
return "NaN"_string;
return MUST(String::formatted("{:.5}", m_value));
return serialize_a_number(m_value);
}
}