Number that is entered into RadzenNumeric<double> raises System.OverflowException. #514

Open
opened 2026-01-29 17:38:31 +00:00 by claunia · 0 comments
Owner

Originally created by @YanBos on GitHub (Aug 18, 2022).

Describe the bug
Adding a number to RadzenNumeric with a constant that is very big results in an error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://blazor.radzen.com/numeric
  2. Click on the field with the title 'Placeholder and 0.5 step'
  3. Enter the number '1237618723687126371263981723987219837981273981273.123123123132' or another number with a very big constant.
  4. See error in console.
Error: System.OverflowException: Value was either too large or too small for a Decimal.
   at System.Number.ThrowOverflowException(TypeCode type)
   at System.Decimal.DecCalc.VarDecFromR8(Double input, DecCalc& result)
   at System.Double.System.IConvertible.ToDecimal(IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at Radzen.ConvertType.ChangeType(Object value, Type type)
   at Radzen.Blazor.RadzenNumeric`1.InternalValueChanged(Object value)
   at Radzen.Blazor.RadzenNumeric`1.OnChange(ChangeEventArgs args)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Expected behavior
It is told to the user that the number entered is too big. The application should not crash.

Screenshots
image
Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
Originally created by @YanBos on GitHub (Aug 18, 2022). **Describe the bug** Adding a number to RadzenNumeric<double> with a constant that is very big results in an error. **To Reproduce** Steps to reproduce the behavior: 1. Go to https://blazor.radzen.com/numeric 2. Click on the field with the title 'Placeholder and 0.5 step' 3. Enter the number '1237618723687126371263981723987219837981273981273.123123123132' or another number with a very big constant. 4. See error in console. ``` Error: System.OverflowException: Value was either too large or too small for a Decimal. at System.Number.ThrowOverflowException(TypeCode type) at System.Decimal.DecCalc.VarDecFromR8(Double input, DecCalc& result) at System.Double.System.IConvertible.ToDecimal(IFormatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at Radzen.ConvertType.ChangeType(Object value, Type type) at Radzen.Blazor.RadzenNumeric`1.InternalValueChanged(Object value) at Radzen.Blazor.RadzenNumeric`1.OnChange(ChangeEventArgs args) at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) ``` **Expected behavior** It is told to the user that the number entered is too big. The application should not crash. **Screenshots** ![image](https://user-images.githubusercontent.com/30951698/185386573-d3febd47-a66b-45c2-815a-3c07b1399977.png) **Desktop (please complete the following information):** - OS: Windows 10 - Browser: Chrome
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#514