We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Unexpected behaviour of decimals with SfNumericUpDown

Hello,
I have noticed a weird behaviour with SfNumericUpDown control:

This is bound to a property in the ViewModel:

private Decimal newWeight;
public Decimal NewWeight
{
get => this.newWeight;
set => this.SetProperty(ref this.newWeight, value);
}

this.SetProperty(); is PRISM implementation of INotifyPropertyChanged feature.

So, the idea is that there should be numeric up down button that increases the provided value by 0.1. The values should be e.g.
10.9
11.0 (or just 11)
11.1
11.2
11.3
11.4
etc etc.

However, what happens is at some values a large number of decimals is added or the number is not correct (too precise for some reason!)
10.9
11.0
11.1
11.2
11.29999999999
11.39999999999
or
11.5
11.6
11.7
11.7999999999

Seems like the incrementing by 0.1 does not use a decimal?

Thanks for looking into that


1 Reply

SK Selva Kumar  Veerakrishnan Syncfusion Team September 4, 2017 01:05 PM UTC

Hi Bartosz,
 
Thank you for contacting Syncfusion support.
 
We have created support incident to track the status of the reported query has been created under your account. 
Please log on to our support website to check for further updates.
 


Loader.
Live Chat Icon For mobile
Up arrow icon