Hi,
I have a problem with % formatter
inside my database, values are for example 0.06520, all datas with 5 decimals maximum
I would like to dispaly 6.52%
but sometimes formatter display things like that 6.52000000000001% or 6.519999999998%
I use:
$col[“formatter”] = “function(cellval,options,rowdata){ return cellval*100+’%’; }”;
what do i wrong ?
Thanks
I’ve tried this:
$col[“formatter”] = “function(cellval,options,rowdata){ return Intl.NumberFormat(‘fr-FR’, {style: ‘percent’, minimumFractionDigits: 2, maximumFractionDigits: 2,}).format(cellval);}”;
it’s OK for display
but not to modify data
ex:
58,14% displayed
but 58,14 % when I want to modify cellvalue
how to unformat correctly?
Georges
I’ve tried this:
$col[“formatter”] = “function(cellval,options,rowdata){ return Intl.NumberFormat(‘fr-FR’, {style: ‘percent’, minimumFractionDigits: 2, maximumFractionDigits: 2,}).format(cellval);}”;
it’s OK for display
but not to modify data
ex:
58,14% displayed
but 58,14 % when I want to modify cellvalue
how to unformat correctly?
Georges