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.
Unfortunately, activation email could not send to your email. Please try again.

Unexpected behaviour of decimals with SfNumericUpDown

Thread ID:

Created:

Updated:

Platform:

Replies:

132456 Sep 3,2017 07:46 AM Sep 4,2017 09:05 AM Xamarin.Forms 1
loading
Tags: SfNumericUpDown
Bartosz Jarmuz
Asked On September 3, 2017 07:46 AM

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


Selva Kumar  Veerakrishnan [Syncfusion]
Replied On September 4, 2017 09:05 AM

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.
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;