Auto space text every 4 characters with CSS?
1 answer
Unfortunately, for now, a JS solution is probably your only interface to achieve formatting across all element types.
They proposed 2 new CSS rules @decimal-format
and number-format
.
@decimal-format price {
grouping-separator: ",";
decimal-separator : "."
}
.price {
number-format: "###,##0.00", "price";
/* price is actually redundant as this format would be the default */
}
Then a simple class will apply the formatting.
<span class="price">987654321</span>
Will display as 987,654,321.00 USD
But this is just an idea that hasn't moved since 2008.
+2
source to share