Hello all
I have simple table column:
<th field="quantity" data-options="formatter:formatdecimal">Quantity</th>
formatdecimal looks like this:
Number.prototype.format = function(n, x, s, c) {
var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\D' : '$') + ')',
num = this.toFixed(Math.max(0, ~~n));
return (c ? num.replace('.', c) : num).replace(new RegExp(re, 'g'), '$&' + (s || ','));
};
function formatdecimal(num){
return num.format(2, 3, '.', ',');
}
and it says "Uncaught TypeError: num.format is not a function"
What is the problem?
Here is original code:
http://jsfiddle.net/hAfMM/612/Is there any other option to format numbers like 123.456,78
(group separator point, decimal separator comma)
Thank you