feat(calculator): localize result

This commit is contained in:
Herculino Trotta
2025-01-06 00:00:57 -03:00
parent 20e03df661
commit 0adb991879

View File

@@ -69,8 +69,7 @@
then call math.evaluate(expr)
if result exists and result is a Number
js(result)
return result.toString().replace(new RegExp(',|\\.', 'g'),
match => match === '.' ? window.decimalSeparator : window.argSeparator)
return result.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 40})
end
then set localizedResult to it
set #calculator-result.innerText to localizedResult