newcoder1010 Posted September 26, 2020 Share Posted September 26, 2020 Hello, <td headers="view-field-units-table-column" class="views-field views-field-field-units">1234 </td> How can I place comma in this format depending on the number of digits? 1234 > 1,234 12345> 12,345 123456>123,456 Thanks! Link to comment Share on other sites More sharing options...
Ingolme Posted September 26, 2020 Share Posted September 26, 2020 CSS can't do it. Ideally, the server-side language would do it. If this is a plain HTML page with no server-side language, the best option is formatting the numbers correctly when writing the HTML. If none of the previous cases apply, Javascript should be able to modify the numbers. In Javascript, toLocaleString() will format the numbers. Link to comment Share on other sites More sharing options...
newcoder1010 Posted September 26, 2020 Author Share Posted September 26, 2020 Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now