Currency column automatically rounding to the nearest dollar

Currency column automatically rounding to the nearest dollar

marcusa007marcusa007 Posts: 26Questions: 4Answers: 0

I have been searching for a while now and can't find where to fix this. I have 2 columns in editor that hold currency but every time I enter a dollar amount with decimals it rounds to the full dollar. I need it to do that at the penny level or not at all. I am sure it is just a setting somewhere but can't find it. Can someone please point me in the right direction. Thanks.

This question has an accepted answers - jump to answer

Answers

  • marcusa007marcusa007 Posts: 26Questions: 4Answers: 0

    this is what I currently have:

    { data: "vendor_billing.invoice_amt", render: $.fn.dataTable.render.number( ',', '.', 2, '$' ) }

  • allanallan Posts: 63,839Questions: 1Answers: 10,518 Site admin

    Could you link me to the page please? Also, if you aren't using 1.10.13 could you update to that version.

    Thanks,
    Allan

  • marcusa007marcusa007 Posts: 26Questions: 4Answers: 0

    I just updated to the new version. I have it on a local environment. Can I send you the code.

  • marcusa007marcusa007 Posts: 26Questions: 4Answers: 0

    I sent the info to get into the page in a private message.

    Thanks

  • allanallan Posts: 63,839Questions: 1Answers: 10,518 Site admin
    Answer ✓

    Thanks for the link. So the issue is that the data from the server is something like: invoice_amt: "550" which is what Editor is editing. Editor edits the raw data, not the rendered data.

    The best thing to do would be to return a 2 decimal place number from the server in the Billing ajax request.

    Allan

  • marcusa007marcusa007 Posts: 26Questions: 4Answers: 0

    You're a savor. You pointed me in the right direction. It was the database, the column was set to decimal (10,0) and switching it to float fixed the problem.

    Thanks :)

This discussion has been closed.