From ed30773e7963d9e70902d834af97937f6f0f9869 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 3 Feb 2020 09:41:49 +0100 Subject: Don’t apply ingredients factor if it’s null --- main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)) + } } } } -- cgit v1.2.3