From 3a0d55353fe88c7510d7b973e1436bd430bcff46 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 4 May 2023 10:46:28 +0200 Subject: [PATCH] Fix WCF.String.addThousandsSeparator() The previously used phrase is no longer available to the JavaScript. It would also be inconsistent. Use `.toLocaleString()`. Fxies #5471 --- wcfsetup/install/files/js/WCF.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }, /** -- 2.20.1