From 4ed431b3ee7fad4a07e902c651b1a2c05340b5d8 Mon Sep 17 00:00:00 2001 From: budiadiono Date: Fri, 22 Feb 2019 15:37:13 +0700 Subject: [PATCH] skip trailing when no decimal separator found --- src/Calculator.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Calculator.tsx b/src/Calculator.tsx index b1df549..be23e2e 100644 --- a/src/Calculator.tsx +++ b/src/Calculator.tsx @@ -467,6 +467,10 @@ export class Calculator extends React.Component { let sep = '' if (value[value.length - 1] === '.') { sep = this.props.decimalSeparator as string + } else { + // skip trailing when no decimal separator found + value += trailing + trailing = '' } // get editing value