Skip to content

Commit

Permalink
Merge pull request #43 from declancarpenter/3
Browse files Browse the repository at this point in the history
fix: prefix and leading zeros
  • Loading branch information
lakshyatyagi24 committed Jun 8, 2023
2 parents 2fec91f + 2df81c5 commit 6fdfe01
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ class _CalculatorScreenState extends State<CalculatorScreen> {
_num1 = 0;
_num2 = 0;
_operator = '';
} else {
} else if (!(buttonText[0] == '0' && _currentNumber[0] == '0')){
if (_currentNumber == '0') {
_currentNumber = '';
}
_currentNumber += buttonText;
}

Expand Down

0 comments on commit 6fdfe01

Please sign in to comment.