feat: Betragseingabe mit Komma (data-type=amount in json-form)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,14 @@
|
||||
out[k] = null;
|
||||
} else if (kind === 'int') {
|
||||
out[k] = parseInt(v, 10);
|
||||
} else if (kind === 'amount') {
|
||||
// Deutsche Betragseingabe: "1.234,56" -> "1234.56". Ohne Komma
|
||||
// bleibt der Wert unveraendert (Punkt-Eingaben funktionieren weiter).
|
||||
var s = String(v).replace(/[\s€]/g, '');
|
||||
if (s.indexOf(',') !== -1) {
|
||||
s = s.replace(/\./g, '').replace(',', '.');
|
||||
}
|
||||
out[k] = s;
|
||||
} else {
|
||||
out[k] = v;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user