From: Tim Düsterhus Date: Thu, 20 Mar 2014 22:44:21 +0000 (+0100) Subject: Fix WCF.String.formatNumeric() X-Git-Tag: 2.1.0_Alpha_1~994 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb9ae99c0fed1a77b4b012fb2dc031a6464d4b04;p=GitHub%2FWoltLab%2FWCF.git Fix WCF.String.formatNumeric() Closes #1598 --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index c50c51dbb1..fbcc4dfcf1 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -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;