How to display SQL server money format correctly in Editor
How to display SQL server money format correctly in Editor
Hi, I have a column stored in the 'Money' format in SQL server. The data returned from PHP shows four decimal places, (so 100.00 is shown as 100.0000. I can format this to 2 decimal places in the datatable column using this snippet:
render: DataTable.render.number(null, null, 2)
I can see that the getFormatter() and setFormatter() methods should be used in my PHP, but how? The inbuilt formats don't seem to fit the bill.
Thanks
This question has an accepted answers - jump to answer
Answers
The
number_format()
method in PHP might do what you want. Use it with a custom formatter - e.g.:Allan
@allan Thank you, that worked