My calculator display limits the numbers shown using the CSS property overflow: hidden
. However, I don't want it to clip characters in half, which is currently happening.
Mozilla suggests using text-overflow: '';
, but this isn't widely supported across browsers. Do you have any alternative suggestions on how to limit the number of characters and clip between characters instead of cutting them off mid-character? (I prefer not to see incomplete numbers on the display)
I'm specifically looking for JavaScript solutions.
Below is my current solution, which only works when inputting numbers and not operators:
// JavaScript code here
.container {
/* CSS styles here */
}
.wrapper {
/* More CSS styles here */
}
/* Additional CSS rules */
<div class="container">
<div class="wrapper">
<!-- Calculator HTML structure -->
</div>
</div>