Hi Seblod team,
I have a text field where only numbers will be saved.
I'm trying to format this number like this :
Original input: 45000 - Formatted: 45,000 XPF
I have try a JS script in STUFF of this text field,i found it on http://stackoverflow.com:
function formatNumber(number)
{
number = number.toFixed(2) + '';
x = number.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
This was just to have a comma separate thousand.
But it give no result.
Thanks for any suggestion...