Skip to content

Commit 8944130

Browse files
Calme1709AtkinsSJ
authored andcommitted
LibWeb: Serialize CSS::Number to spec
We were previously serializing with 5 instead of 6 digits of precision
1 parent 76108b1 commit 8944130

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Libraries/LibWeb/CSS/Number.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <AK/Math.h>
88
#include <LibWeb/CSS/Number.h>
9+
#include <LibWeb/CSS/Serialize.h>
910

1011
namespace Web::CSS {
1112

@@ -19,7 +20,7 @@ String Number::to_string(SerializationMode) const
1920
return "-infinity"_string;
2021
if (isnan(m_value))
2122
return "NaN"_string;
22-
return MUST(String::formatted("{:.5}", m_value));
23+
return serialize_a_number(m_value);
2324
}
2425

2526
}

0 commit comments

Comments
 (0)