HanSolo / medusa

A JavaFX library for Gauges
Apache License 2.0
688 stars 129 forks source link

Inconsistent value display in LcdSkin #153

Closed protogenes closed 5 years ago

protogenes commented 6 years ago

The min and max value for the Lcd are created with String.format("%....f") and therefor correctly rounded HALF_UP. This is inconsistent with the main value display which is created in Helper#formatNumber which truncates the value to the wanted amount of digits before formatting it. So the displayed values might be off in the last displayed digit. What is the rationale behind truncating values? In general I would prefer rounding over truncation for a better accuracy of the shown value, but the approach should be consistent at least.

HanSolo commented 5 years ago

Fixed with commit: 57dd873fb42da4cfa9112c81fdcfd53c9a35c96c