Ewl » Canonical The canonical version of EWL Read More
Clone URL:  
Pushed to 3 repositories · View In Graph Contained in tip and canonical

Fixed numeric-scale bug in FormItemStatics.

Changeset 659e9b229c59

Parent 5455061daa66

by Profile picture of William GrossWilliam Gross

Changes to one file · Browse files at 659e9b229c59 Showing diff from parent 5455061daa66 Diff from another changeset...

 
285
286
287
288
 
 
 
 
289
290
291
 
285
286
287
 
288
289
290
291
292
293
294
@@ -285,7 +285,10 @@
  private static string getNumberControlValueStepStatements( ModificationField field ) {   if( ( !field.TypeIs( typeof( decimal ) ) && !field.TypeIs( typeof( decimal? ) ) ) || !field.NumericScale.HasValue )   return ""; - var minStep = field.NumericScale.Value == 0 ? "1" : ".{0}1m".FormatWith( string.Concat( Enumerable.Repeat( '0', field.NumericScale.Value - 1 ) ) ); + var minStep = field.NumericScale.Value == 0 + ? "1" + : ".{0}1m".FormatWith( + string.Concat( Enumerable.Repeat( '0', Math.Min( field.NumericScale.Value, (short)28 /* max scale for decimal */ ) - 1 ) ) );   return StringTools.ConcatenateWithDelimiter(   Environment.NewLine,   "if( !valueStep.HasValue ) valueStep = {0};".FormatWith( minStep ),