Skip to content

Commit 1fe2959

Browse files
committed
Fix Size output for locales that use non-period decimal separators
e.g., a locale like pt_PT parses this: width: 0.15em; as "0,15".
1 parent 34fcc74 commit 1fe2959

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sabberworm/CSS/Value/Size.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public function isRelative() {
6060
}
6161

6262
public function __toString() {
63-
return str_replace('0.', '.', $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit);
63+
$l = localeconv();
64+
return str_replace(array($l['decimal_point'], '0.'), '.', $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit);
6465
}
6566

6667
}

0 commit comments

Comments
 (0)