diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2015-02-25 23:19:30 +0200 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2015-03-11 08:38:58 +0200 |
commit | 155ffa7560e6445557ad2d04d2f83411c391debb (patch) | |
tree | 22bc0ff89f6b5ef9e1e0e24a5bf393122ea436cf /server/src/com/vaadin/ui/Slider.java | |
parent | 21c73437439539276c6f4152fa149c201db94d95 (diff) | |
download | vaadin-framework-155ffa7560e6445557ad2d04d2f83411c391debb.tar.gz vaadin-framework-155ffa7560e6445557ad2d04d2f83411c391debb.zip |
Use Math.floor instead of casting to int when trimming decimals. (#16926)
Change-Id: I02802b910d0dc90221483fedbf05be48958d8dcc
Diffstat (limited to 'server/src/com/vaadin/ui/Slider.java')
-rw-r--r-- | server/src/com/vaadin/ui/Slider.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/Slider.java b/server/src/com/vaadin/ui/Slider.java index dad4d295bf..fab6e33cae 100644 --- a/server/src/com/vaadin/ui/Slider.java +++ b/server/src/com/vaadin/ui/Slider.java @@ -267,7 +267,7 @@ public class Slider extends AbstractField<Double> { if (resolution > 0) { // Round up to resolution - newValue = (int) (v * Math.pow(10, resolution)); + newValue = Math.floor(v * Math.pow(10, resolution)); newValue = newValue / Math.pow(10, resolution); if (getMin() > newValue || getMax() < newValue) { throw new ValueOutOfBoundsException(newValue); |