Fix empty input handling of fromUserInput
This commit is contained in:
parent
3175384a1f
commit
9545245267
@ -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 = "";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user