Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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>

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.