We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67c4c64 commit 73ff692Copy full SHA for 73ff692
main.js
@@ -16,12 +16,17 @@ document.addEventListener('DOMContentLoaded', function() {
16
displayValue = "";
17
}
18
displayValue += value;
19
- if (displayValue.length > MAX_DISPLAY_LENGTH) {
20
- displayValue = parseFloat(displayValue).toExponential(MAX_DISPLAY_LENGTH - 7);
21
- }
+ displayValue = formatDisplay(displayValue);
22
displayOutput.textContent = displayValue;
23
24
+ function formatDisplay(value) {
+ if (value.length > MAX_DISPLAY_LENGTH) {
25
+ return parseFloat(displayValue).toExponential(MAX_DISPLAY_LENGTH - 7);
26
+ }
27
+ return value;
28
29
+
30
function resetDisplay() {
31
32
calculationJustCompleted = false;
0 commit comments