Skip to content

Commit

Permalink
add appendDot to calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuelefavero committed Mar 6, 2024
1 parent 23346f9 commit 103c4ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions calculator.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@
display.innerText = -value
}

function appendDot() {
if (!display.innerText.includes('.')) {
display.innerText += '.'
}
}

function clearDisplay() {
display.innerText = '0'
}
Expand Down

0 comments on commit 103c4ff

Please sign in to comment.