Skip to content

Commit

Permalink
refactor: updated text on readme and textsection, and fixed NaN bug w…
Browse files Browse the repository at this point in the history
…ith calculator
  • Loading branch information
Andreas Kluge Svendsrud authored and Andreas Kluge Svendsrud committed Sep 19, 2024
1 parent d6d0c14 commit ef13112
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# My Calculator

This project showcases a Vue.js-based calculator application, highlighting both the framework’s powerful capabilities and my expertise in web development. The calculator is designed to perform basic arithmetic operations, including addition, subtraction, multiplication, and division. It also supports percentage calculations and negative number operations. Link: https://kluge7.github.io/my-calculator/
This project showcases a Vue.js-based calculator application, highlighting both the framework’s powerful capabilities and my expertise in web development. The calculator is designed to perform basic arithmetic operations, including addition, subtraction, multiplication, and division. It also supports percentage calculations and negative number operations.

**This calculator is fully optimized for mobile devices and can be seamlessly used on your phone.**

Link: https://kluge7.github.io/my-calculator/
3 changes: 3 additions & 0 deletions src/components/TextSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
multiplication, and division. It also supports percentage calculations and negative number
operations.
</p>
<p>
<strong>My Calculator is fully optimized for mobile devices and can be seamlessly used on your phone.</strong>
</p>
</div>
</template>

Expand Down
5 changes: 1 addition & 4 deletions src/components/calculator/SimpleCalculator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { evaluate } from 'mathjs'
const displayValue = ref('')
const handleCalculatorButtonClick = (value: string) => {
if (
(displayValue.value === 'Error' || parseFloat(displayValue.value) === Infinity) &&
value !== '='
) {
if (((displayValue.value === 'Error') || (parseFloat(displayValue.value) === Infinity) || isNaN(parseFloat(displayValue.value))) && value !== '=') {
displayValue.value = ''
}
if (value === 'AC') {
Expand Down

0 comments on commit ef13112

Please sign in to comment.