Thousands separator
Thousands separator
BJW86
Posts: 30Questions: 11Answers: 0
Is it possible to get thousands separator working for rendered data? Like I have set for the second column?
http://live.datatables.net/botuguzu/1/edit
Thanks,
Bruce
Answers
Yes it is possible! Your example demonstrates it!
But what is your question? ...
I have used the render function in the first column but not in the second, so the thousand separator is only working for the second column, I am trying to get it to work for both!
In the first column you will need to run the number renderer for each number, for example:
Chain
.display()
to provide the number to the renderer.Also note that you can't have two render functions defined for a column. The number renderer is not running for column 0 since you have
columns.render
defined. See thecolumnDefs
conflict resolution docs for details. Also note that the number renderer only works with numbers not with cells that have extra data like column 0.Updated example:
http://live.datatables.net/botuguzu/3/edit
Kevin
Kevin is bob on - you are putting the numbers into your own inner table, so you need to renderer them with the helper function. But want I wanted to check was if it is intentional to use an inner table like that, rather than just having three columns in the host table?
Allan
Hi Kevin that's brilliant thank you! Thanks for explaining, makes sense now.
Kevin I need display some values from the same array vertically so this was the only way I could figure out of doing it, is there another easier way?
Thanks,
Bruce
You can join() the array with an HTML line break
br
usingcolumns.render
, for example:Kevin