Fix WCF.String.formatNumeric()
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 20 Mar 2014 22:44:21 +0000 (23:44 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 20 Mar 2014 22:44:21 +0000 (23:44 +0100)
Closes #1598

wcfsetup/install/files/js/WCF.js

index c50c51dbb1f30f502a7a7fac880cbd4135821120..fbcc4dfcf1dbd579d8d4018c2aeab70c7a49e30b 100755 (executable)
@@ -3670,9 +3670,11 @@ WCF.String = {
         */
        formatNumeric: function(number, decimalPlaces) {
                number = String(WCF.Number.round(number, decimalPlaces || 2));
-               number = number.replace('.', WCF.Language.get('wcf.global.decimalPoint'));
+               numberParts = number.split('.');
+               
+               number = this.addThousandsSeparator(numberParts[0]);
+               if (numberParts.length > 1) number += WCF.Language.get('wcf.global.decimalPoint') + numberParts[1];
                
-               number = this.addThousandsSeparator(number);
                number = number.replace('-', '\u2212');
                
                return number;