diff --git a/sao/src/common.js b/sao/src/common.js index f511ea8f01..33d6a35300 100644 --- a/sao/src/common.js +++ b/sao/src/common.js @@ -1976,8 +1976,13 @@ } let { format } = new Intl.NumberFormat( Sao.i18n.BC47(Sao.i18n.getlang())); + // use 10000 because some language (ex: es) add thousand + // separator only after 9999 + let [, thousandSeparator] = /^10(.)?000/.exec(format(10000)); let [, decimalSign] = /^0(.)1$/.exec(format(0.1)); - return Number(string.replace(decimalSign, '.')); + return Number(string + .replace(new RegExp(thousandSeparator, 'g'), '') + .replace(decimalSign, '.')); } var convert_selection = function() { if (typeof value == 'string') {