diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index 47b3670a7..6c09cdc59 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -211,7 +211,8 @@ namespace Tango.Touch.Controls } if (Step > 0) { - value = Math.Round(value / Step, MidpointRounding.AwayFromZero) * Step; + int coef = (int)((value + Step - 1) / Step); + value = coef * Step; } if(Minimum > 0 && value < Minimum) { |
