Formatting numbers within editor

Formatting numbers within editor

matt_rumsey1212matt_rumsey1212 Posts: 51Questions: 8Answers: 0

I am using the... "render": $.fn.dataTable.render.number(',', ':', 2) ...option to render numbers within my table. Is there any way to carry this formatting through to the editor form as well?

Thanks, Matt

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin
    Answer ✓

    Possibly... The Editor edits the raw data, and generally you don't want your user to need to edit the formatted value (for example, if they are shown $100 and change it to be €100 what happens?).

    If you do need this, then formatting the data using formatters at the server-side is how I would recommend doing it.

    Allan

  • matt_rumsey1212matt_rumsey1212 Posts: 51Questions: 8Answers: 0

    Thanks Allan, I see your point about user input; however this is literally formatting a decimal number to appear as 2 decimal places. For some reason when the database was created the field in question was set to 5 decimal places which is plain unnecessary.

    Thanks as always,
    Matt

This discussion has been closed.