Skip to content

Commit

Permalink
skip trailing when no decimal separator found
Browse files Browse the repository at this point in the history
  • Loading branch information
budiadiono committed Feb 22, 2019
1 parent 173ae83 commit 4ed431b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Calculator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ export class Calculator extends React.Component<CalculatorProps, State> {
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
Expand Down

0 comments on commit 4ed431b

Please sign in to comment.