2

I have these numbers 10010999.00 and 8094.456 and 456.78

And all I want to do is add a comma in the right place if it needs it so it looks like this 10,010,999.00 and 8,094.45 and 456.78 in the JSP page.

Dawid C
  • 413
  • 3
  • 10

2 Answers2

2

You can do this via toLocaleString() function.

hamed
  • 7,939
  • 15
  • 60
  • 114
1

Short answer: You can't. It was proposed in 2008 as Content Data Function addition to CSS3, however nothing came of it. You will need to perform this action in Javascript.

There is a suggestion on how to format numbers in JS in this answer: Format numbers in javascript

Community
  • 1
  • 1
Ryan McDonough
  • 9,732
  • 3
  • 55
  • 76