Max amount of numbers allowed in a field with field type double, integer

Was this article helpful?

Still need help? contact us

Comments

1 comment

  • Avatar
    Jesse Reinikka

    In here it is mentioned that Double data type can support 1.8 × 10^308. Yet when you update a large value from the UI, this breaks it completely (as mentioned in the warning). The details tab of the entity no longer opens and you are forced to clear it through e.g. Excel import.

    In my case, I had simply put a value 2.42133212212132E+29, which is well within the specification. Then looking at the error inriver logged after putting the value and trying to load the entity: 

    An error occurred System.OverflowException: Value was either too large or too small for a Decimal. at System.Decimal..ctor(Double value) at inRiver.Portal.Misc.StringUtil.GetStringValue(Object data, CultureInfo ci, String dataType, Boolean multivalue, String cvlId, IReadOnlyDictionary`2 cvlValueDictionary) in C:\s\src\Portal\inRiver.Portal\Misc\StringUtil.cs:line 144 at inRiver.Portal.Misc.StringUtil.GetStringValue(Field field, IReadOnlyDictionary`2 cvlValueDictionary) in C:\s\src\Portal\inRiver.Portal\Misc\StringUtil.cs:line 60 at inRiver.Portal.Api.Models.RestfulField.CreateFromField(Field field, Entity e, EntityType entityType, List`1 languages, Category category, Boolean includePossibleCvlValues, Nullable`1 maxNumberOfInlineCvlValues, IReadOnlyDictionary`2 cvlDictionary, IReadOnlyDictionary`2 cvlValueDictionary) in C:\s\src\Portal\inRiver.Portal\Api\Models\RestfulField.cs:line 290 at inRiver.Portal.Api.Models.RestFactory.<>c__DisplayClass6_0.<CreateFromEntityAndFields>b__6(Field x) in C:\s\src\Portal\inRiver.Portal\Api\Models\RestFactory.cs:line 296 at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at inRiver.Portal.Api.Models.RestFactory.CreateFromEntityAndFields(Entity entity, List`1 fields, Boolean includeHiddenFields, Boolean includePossibleCvlValues, Boolean isContentSegmentationDisabled) in C:\s\src\Portal\inRiver.Portal\Api\Models\RestFactory.cs:line 293 at inRiver.Portal.Api.Remote.DataService.EntityFieldsv2Controller.Get(Int32 entityId, Boolean includeHiddenFields) in C:\s\src\Portal\inRiver.Portal\Api\Remote\DataService\EntityFieldsv2Controller.cs:line 46 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Filters.Ac

    Which raises the question: why are you trying to convert Double to a Decimal, when C# Decimal can only support a maximum value of 79,228,162,514,264,337,593,543,950,335 instead of the 1.8 × 10^308?

    Why is this not mentioned in this article? From the default implementation perspective, the value 79,228,162,514,264,337,593,543,950,335 is your limit, not 1.8 × 10^308.

    0

Please sign in to leave a comment.