PolymerElements / iron-range-behavior

Managing a numeric value within a given range
8 stars 16 forks source link

round value with decimal precision #27

Open fl4p opened 7 years ago

fl4p commented 7 years ago

jsbin with paper-slider: https://jsbin.com/votacuzaxe/edit?html,output

The current work around seems no to be working anymore (compiler optimizations?).

My fix rounds the value with decimal precision.

fl4p commented 7 years ago

Just fixed a rounding issue that made the tests fail.

And: Checking for step < 1 is not sufficient, precision issues can occur for all non-integer steps, like 1.001. I found the only solution is to compute the decimal places of step with its string representation and use this precision for final rounding of value.

tapionx commented 6 years ago

i confirm the issue, please merge this PR