Commas for decimal place
Commas for decimal place
nico077
Posts: 55Questions: 14Answers: 2
I have a problem with the commas decimal.
When I enter an amount and i use a comma instead of a point, the decimal isn't register.
Example : when i enter 50,20 the datatable save 50. But when i entrer 50.20 it's ok.
I try to use language.decimal but it doesn't work.
I try to use 'dataTables.numericComma.js' but I got the error message : 'TypeError: jQuery.fn.dataTableExt is undefined'
Best Regards,
Nicolas
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Have you got a solution please ?
Hi Nicolas,
When you say that the database is saving an integer value, what you are using to submit the value and save it? Are you using something to convert from the comma form to the period form that programming languages and databases will recognise as a floating point number?
Allan
Hi Allan,
When i create a new entry or I use the bubble.
I don't use a program to convert the comma form.
I have read :
https://editor.datatables.net/manual/php/formatters
https://datatables.net/examples/basic_init/comma-decimal.html
But I don't resolve my problem...
Nicolas
I want to use the columns.type function with num-fmt ? Is it the solution ?
You are going to have to give me a bit more information I'm afraid. Do you want to submit a value such as "3,33" (where the comma is a decimal place)? If so, you need to use a set formatter on the server side to convert that to be a decimal number that all databases and programming languages will see as a number.
Allan
Thank you Allan,
I solved the problem with :
->setFormatter( function($val, $data, $field) {
return str_replace ( ',' , '.' , $val );
}),