espruino / BangleApps

Bangle.js App Loader (and Apps)
https://banglejs.com/apps
MIT License
496 stars 1.17k forks source link

calculator: truncate long numbers #3562

Closed flaparoo closed 2 months ago

flaparoo commented 2 months ago

If the resulting number is longer than can be displayed, truncate it so that the (usually) significant part is displayed. A '-' is append to indicate a truncated number (the font doesn't provide a better character for this than '-').

For example, before this change a simple "5 / 3" resulted in only 6s being displayed - rather than a more useful "1.666666-".

thyttan commented 2 months ago

(the font doesn't provide a better character for this than '-').

Could we go with '...' instead? That seems less ambiguous to me.

flaparoo commented 2 months ago

Ah yes, it's not a fixed-width font. "..." is better.

thyttan commented 2 months ago

Thanks!