Hi All,
we're evaluating the Telerik Suite of controls for our products. While testing your RadNumericUpDown, I found a rather serious issue (or so it seems): setting the NumberOfDecimalDigits actually rounds the inner value to that precision. I am expecting that the value stays the same and the aforementioned property only affects the DISPLAY of that value.
Code to reproduce:
this unit test fails with:
this means that the value gets immediately truncated to the NumberOfDecimalDigits and then further changes to NumberOfDecimalDigits do not modify it anymore... Really odd!
Can you tell me more about this?
Thanks a lot.
Alessandro
we're evaluating the Telerik Suite of controls for our products. While testing your RadNumericUpDown, I found a rather serious issue (or so it seems): setting the NumberOfDecimalDigits actually rounds the inner value to that precision. I am expecting that the value stays the same and the aforementioned property only affects the DISPLAY of that value.
Code to reproduce:
[Test]
public
void
Value_NumberDecimalDigitsIsLessThanPrecision_IsNotModified()
{
_nud.NumberFormatInfo.NumberDecimalDigits = 3;
_nud.Value = 100.12345;
_nud.NumberFormatInfo.NumberDecimalDigits = 0;
Assert.That(_nud.Value, Is.EqualTo(100.12345));
}
this unit test fails with:
Expected: 100.12345000000001d
But was: 100.123d
this means that the value gets immediately truncated to the NumberOfDecimalDigits and then further changes to NumberOfDecimalDigits do not modify it anymore... Really odd!
Can you tell me more about this?
Thanks a lot.
Alessandro