Don't attempt to localize numbers in SpinBoxFloat

Issue report: 
https://forums.ankiweb.net/t/anki-2-1-50-beta-6-release-candidate/18181/71

Localization was added in #1566. It works fine in the Qt5 build, but
the Qt6 build appears broken. This appears to be a change in Chromium,
and the latest Chrome has the same issue. Whether it's a legitimate bug
on their end, a deliberate change in behaviour, or we're doing something
wrong, I do not know.
This commit is contained in:
Damien Elmes 2022-03-29 14:33:46 +10:00
parent ebe33a993c
commit 91ca5090aa

View File

@ -3,7 +3,6 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import { localizedNumber } from "../lib/i18n";
import { pageTheme } from "../sveltelib/theme";
export let value: number;
@ -11,7 +10,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let max = 9999;
let stringValue: string;
$: stringValue = localizedNumber(value, 2);
$: stringValue = value.toFixed(2);
function update(this: HTMLInputElement): void {
value = Math.min(max, Math.max(min, parseFloat(this.value)));