6

Is it possible to format numbers using css ?

When I have 7000000.00, I would like it displayed as 7 000 000.00

I know I could write a backend (php, perl...) function or a javascript function that could return the formatted number but...

The numbers that I want to format are into a cell. I would like to have something like

<td class="myformat">7000000.00</td>
or
<td><span class="myformat">7000000.00<span></td>

Luc M
  • 285
  • 1
  • 4
  • 11

1 Answers1

8

Currently CSS does not format numbers in the way you are hoping although it does look like it's being discussed. For now you're best bet is to stick with server-side formatting. You could do it with JavaScript but that wouldn't be as reliable as server side technologies since users can turn it off.

John Conde
  • 86,255
  • 27
  • 146
  • 241