Fix empty input handling of fromUserInput

This commit is contained in:
Simon Warta 2022-06-27 10:31:14 +02:00
parent 3175384a1f
commit 9545245267

View File

@ -24,7 +24,10 @@ export class Decimal {
let whole: string;
let fractional: string;
if (input.search(/\./) === -1) {
if (input === "") {
whole = "0";
fractional = "";
} else if (input.search(/\./) === -1) {
// integer format, no separator
whole = input;
fractional = "";