fix: Get language instead of hard coding

The language data that is used to set the locale of the session is now
grabbed from the DOM intstead of relying on a hardcoded value.
This commit is contained in:
Robert Morrison 2022-10-08 03:45:55 +01:00
parent ca43dafd6a
commit 1076cd2895
Signed by: robert
GPG Key ID: 73E012EB3F4EC696

View File

@ -37,8 +37,11 @@
// GNU won't support my choice of browser so I won't support their tool
function formatNumbers() {
const numbers = document.getElementsByTagName("num");
const formatter = Intl.NumberFormat(navigator.language);
const documentLanguage = document.documentElement.lang;
const formatter = Intl.NumberFormat(documentLanguage);
for (let num of numbers) {
var number = parseFloat(num.innerHTML);
if (isNaN(number)) {