aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris2020-02-03 09:41:49 +0100
committerJoris2020-02-03 09:41:49 +0100
commited30773e7963d9e70902d834af97937f6f0f9869 (patch)
treebca2bd6e71db8cc8b8c58f380e3ea334a807e3e1
parent6b9fef06847e55aee2f93ece513a0d62ee7e359c (diff)
Don’t apply ingredients factor if it’s null
-rw-r--r--main.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.ts b/main.ts
index 6b64881..a101d9f 100644
--- a/main.ts
+++ b/main.ts
@@ -40,7 +40,9 @@ inputs.map(input => {
if (parsed !== undefined && parsed.before === '' && parsed.after === '') {
const factor = parsed.number / input.number
- inputs.map(input2 => input2.node.value = prettyPrintNumber(input2.number * factor))
+ if (factor !== 0) {
+ inputs.map(input2 => input2.node.value = prettyPrintNumber(input2.number * factor))
+ }
}
}
}