From: Tim Düsterhus Date: Thu, 4 May 2023 08:46:28 +0000 (+0200) Subject: Fix WCF.String.addThousandsSeparator() X-Git-Tag: 6.0.0_Alpha_1~162 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a0d55353fe88c7510d7b973e1436bd430bcff46;p=GitHub%2FWoltLab%2FWCF.git Fix WCF.String.addThousandsSeparator() The previously used phrase is no longer available to the JavaScript. It would also be inconsistent. Use `.toLocaleString()`. Fxies #5471 --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 3e69beab3b..76539306ae 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1936,7 +1936,7 @@ WCF.String = { * @return string */ addThousandsSeparator: function(number) { - return String(number).replace(/(^-?\d{1,3}|\d{3})(?=(?:\d{3})+(?:$|\.))/g, '$1' + WCF.Language.get('wcf.global.thousandsSeparator')); + return Number(number).toLocaleString(document.documentElement.lang); }, /**