diff options
-rw-r--r-- | main.ts | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -40,9 +40,11 @@ inputs.map(input => { if (parsed !== undefined && parsed.before === '' && parsed.after === '') { const factor = parsed.number / input.number - if (factor !== 0) { - inputs.map(input2 => input2.node.value = prettyPrintNumber(input2.number * factor)) - } + inputs.map(input2 => { + if (input.node !== input2.node) { + input2.node.value = prettyPrintNumber(input2.number * factor) + } + }) } } } @@ -152,7 +154,7 @@ function parseNumber(str: string): ParsedNumber | undefined { return { before: str.substring(0, start), - number: parseFloat(integerPart + (decimalPart !== '' ? '.' + decimalPart.substring(0, 2) : '')), + number: parseFloat(integerPart + (decimalPart !== '' ? '.' + decimalPart : '')), after: str.substring(end, str.length) } } |