mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
change minus sign to negative sign automatically
This commit is contained in:
@@ -146,6 +146,11 @@ export default {
|
||||
return `${integer}.${newDecimals}`;
|
||||
},
|
||||
inputNum(num) {
|
||||
if (!this.previousValue && this.currentSymbol === '−') {
|
||||
this.currentValue = '-' + this.currentValue;
|
||||
this.currentSymbol = '';
|
||||
}
|
||||
|
||||
if (this.currentValue === '0') {
|
||||
this.currentValue = num.toString();
|
||||
return;
|
||||
@@ -187,6 +192,11 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.previousValue && this.currentSymbol === '−') {
|
||||
this.currentValue = '-' + this.currentValue;
|
||||
this.currentSymbol = '';
|
||||
}
|
||||
|
||||
if (this.currentValue.length < 1) {
|
||||
this.currentValue = '0';
|
||||
} else if (this.currentValue === '-') {
|
||||
|
||||
Reference in New Issue
Block a user