question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NumericUpDown control

See original GitHub issue

Describe the bug When the NumericUpDown control is at a value of 5.6 and Increment is 0.01, if adjusted up, it will appear as 0.570000000000000001 instead of 0.57

Code <NumericUpDown Value="0.56" Minimum="0" Maximum="10" Increment="0.01"/>

Expected behavior The value should beThe value should be 0.57

Screenshots image image

Desktop (please complete the following information):

  • OS: win 10
  • Version 0.9.12

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
sn4k3commented, Jan 24, 2021

Related: https://github.com/AvaloniaUI/Avalonia/issues/4756 To fix this i’m using FormatString=“{}{0:0.00}”

1reaction
pr8xcommented, Jan 20, 2021

I think we should port NumericUpDown.DecimalPlaces from WPF to correctly round the values: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.numericupdown.decimalplaces?view=net-5.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

NumericUpDown Class (System.Windows.Forms)
A NumericUpDown control contains a single numeric value that can be incremented or decremented by clicking the up or down buttons of the...
Read more >
NumericUpDown Control - Windows Forms .NET Framework
The control displays and sets a single numeric value from a list of choices. The user can increase and decrease the number by...
Read more >
NumericUpDown In C#
A NumericUpDown control allows users to provide a spin (up/down) interface to move through pre-defined numbers using up and down arrows.
Read more >
C# | NumericUpDown Class
In Windows Forms, NumericUpDown control is used to provide a Windows spin box or an up-down control which displays the numeric values.
Read more >
C# - How to use NumericUpDown control?
It allows the users to increment or decrement the value within the given range by using Keyboard Up & Down arrow keys or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found