fix: use Math.round in place of truncating digits
This commit is contained in:
parent
fb3e12b8a7
commit
f5417bcc8d
2 changed files with 2 additions and 2 deletions
|
@ -199,5 +199,5 @@ export function makeValue(value, cond) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getApproxNumberThreshold(number) {
|
export function getApproxNumberThreshold(number) {
|
||||||
return (Math.abs(number) * 0.075) | 0;
|
return Math.round(Math.abs(number) * 0.075);
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,7 @@ export function extractScheduleConds(conditions) {
|
||||||
|
|
||||||
export function getScheduledAmount(amount) {
|
export function getScheduledAmount(amount) {
|
||||||
if (amount && typeof amount !== 'number') {
|
if (amount && typeof amount !== 'number') {
|
||||||
return ((amount.num1 + amount.num2) / 2) | 0;
|
return Math.round((amount.num1 + amount.num2) / 2);
|
||||||
}
|
}
|
||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue