4

Possible Duplicate:
Formatting numbers (decimal places, thousands separators, etc) with CSS

I'm working on a web application for statistics (LAMP platform), and I was wondering if CSS3 could take care of thousands separation in numbers.

For example, I would like that a writing just like

Items sold: 101715

could appear like

Items sold: 101 715

So with a space as a thousands separator.

I know I can have it with PHP, and also that for something like CSS3 this has to do with semantic evaluation of related content, but I started wondering if this could be possible.

Anyone?

Community
  • 1
  • 1
Federico Zancan
  • 4,846
  • 4
  • 44
  • 60
  • 1
    **Javascript:** [`(1234567).toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString) formats the number with commas/dots/spaces/etc as required for the client's browser locale setting.... or, force a specific format by specifying locale. For example, `(1234567).toLocaleString('en-CA')` returns `"1,234,567"` – ashleedawg Mar 08 '20 at 14:57

1 Answers1

5

No CSS cant format numbers, if you would like to do something like that in the client, you would have to look into javascript.

Stig Hausberg
  • 836
  • 6
  • 9