Skip to content

Commit 1272126

Browse files
committed
Fix formatNumber() for "-0"
1 parent f983e3b commit 1272126

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

parse-css.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,9 @@ function escapeString(string) {
792792

793793
function formatNumber(num, sign=undefined) {
794794
// TODO: Fix this to match CSS stringification behavior.
795-
return (sign == "+" ? "+" : "") + String(num);
795+
let n = String(num);
796+
if (n[0] === '-') n = n.slice(1);
797+
return (sign || "") + n;
796798
}
797799

798800
// Exportation.

0 commit comments

Comments
 (0)