CONVERT DECIMAL TO CURRENCY IN SERVER SIDE DATATABLE

CONVERT DECIMAL TO CURRENCY IN SERVER SIDE DATATABLE

gkahanagkahana Posts: 3Questions: 1Answers: 0

Hello allan.
I need to format decimal to currency in server side datatable.
My Data which I return in Page is { "mData": "TotalAmount" } I need to display the result in format of e.g 10,000,000.00 instead of e.g 232206368.75

Answers

  • gkahanagkahana Posts: 3Questions: 1Answers: 0

    My Code which i was trying to convert is
    {
    "mData": "TotalAmount",
    "render": function (data, type, row) {
    return accounting.formatMoney(data, { format: "%v" });
    }
    },

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @gkahana ,

    Yep, that's one way to go, you can also use the intl plugin. I'm not clear if you got it working in your last comment, if not, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.