aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/main.ts b/main.ts
index ab3f2bf..c120377 100644
--- a/main.ts
+++ b/main.ts
@@ -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)
}
}