Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
WebNumericEdit Particula decimal value Change.
posted

Hi Team,

I am trying to create WebNumericEdit dynamically and set property too .But the problem is, if I set DecimalValue = 6.810 then the control converted it self as 6.810000000005 . It's happen only for particular value not for others .

Version using :2008 (2.0)

Code Example.

Case DataType.IsDecimal

control = New WebNumericEdit

With DirectCast(control, WebNumericEdit)

.ID = "wne"

.MaxLength = field.MaxLength

.ReadOnly = field.EnforceList

If field.Mask.Length > 0 Then

.MinDecimalPlaces = CType(field.Mask, MinDecimalPlaces)

End If

.ValueDecimal = Decimal.Parse(field.Value, CultureInfo.InvariantCulture) 

End If

End With

Parents
No Data
Reply
  • 4315
    Offline posted
    Hi, Gyanendra.

    Thank you for using our product!

    I've tried to set the value in the latest version of our product in the following way:

    this.WebNumericEditor.ValueDecimal = 6.810m;

    I believe that updating to the latest version will fix the issue. Is it possible for you to do that?

    To be sure that you can send me the numbers that you are having trouble with them and I will test them. It seems that 6.810 is not one of them?

    I've looked at the source code of the WebNumericEditor and when settings the ValueDecimal the following code is executed:

    this.ValueText = value.ToString(CultureInfo.InvariantCulture);

    Trying the result here it seems the value should not be formatted the way you see it.
    I will wait for your feedback!

    Best regards,
    Nikolay Alipiev
    Software Developer
Children
No Data