I have a page with lots of big number values. Millions and billions of dollars going everywhere. And it is hard to read these numbers, so my client asks me to break them into more readable chunks of three symbols, "$100000000" => "$100 000 000".
This is completely reasonable request, but the problem is that I do not want to do this on server-side, and I do not want to do this with javascript. You see, I have a really big heap of javascript already running on this page, doing complex computations on these long numbers, and it will be really difficult to insert a parseReadableStringToInteger()
in every place that reads data from page and a writeIntegerAsReadableString()
in every place that writes results back to page.
So, I am thinking of using CSS to make long string display as a set of short chunks. My first thought was of -moz-column
and -webkit-column
, but unfortunately, they work only with words that are already separated by space.
Maybe there is another way? Any suggestions are welcome.
p.s. Cross-browser compatibility is not required. I'm ok with Gecko and/or Webkit.