Add dollar sign and two decimal places to an entire column
Add dollar sign and two decimal places to an entire column
goopcat
Posts: 4Questions: 2Answers: 0
Been struggling for a few days to get this to work right. Other discussions have deprecated contents that won't work any more. I cant even get the fnFormatNumber example to work.
Let me know what you need of my code to give any help.
This discussion has been closed.
Answers
DataTables has a built in number renderer as of 1.10. The feature isn't fully developed which is why there is little documentation about it, but the Editor examples use it. For example:
will render the
salary
number with a,
as the thousands separator,.
as the decimal place,0
decimal places and$
as the prefix. This is the prototype for the number renderer.I plan to expand on that feature and document it more completely in future with plug-ins being available to provide different renderer types. Just a question of getting the time to do so!
Allan