yiyoaome / range-seek-bar

Automatically exported from code.google.com/p/range-seek-bar
0 stars 0 forks source link

Integer rounding bug. #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In some rare cases the function new Integer((int) value) in the toNumber(double 
value) function works wrong. 

When I debug it, I got 2.999999 for the value and when you simple cast it to 
(int) it will be 2. 

Instead, I changed the line into this and it works very good. 
                                return new Integer((int) Math.round(value));

Original issue reported on code.google.com by tasoman...@gmail.com on 13 Mar 2014 at 12:34