From 1c7f16c34f85dd65a02ad08dde984f04a4d82b83 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 18 Apr 2023 14:47:53 +0300 Subject: PPC Eureka. Power button, new dialog. --- Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.Touch') 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) { -- cgit v1.3.1