overflow under conversion of Microsoft.Dynamics.Nav.Runtime.Decimal18 value 0.37381002500 to system.Int32

TensDec := ((No * 100) MOD 100) DIV 10;
OnesDec := (No * 100) MOD 10;

while debug it shows error on 1401 report. on second line.

0.37381002500 it store in OnesDec variable but OnesDec is integer type variable. It not store long length number what should I do??? 

Please give me solution for this.

  • .. First Step.. Get a Coffee...;-)

    Depends what you want to do.. You may define OnesDec as Decimal .. Or if you need the Integer Value you may change Code to

    OnesDec := ROUND ((No*100) MOD 10, 1, '=');

    '=' rounds up or down to the nearest value (default). Values of 5 or greater are rounded up. Values less than 5 are rounded down.

    '>' rounds up

    '<' rounds down

    In your Example you should get a 0 as result
  • In reply to dirk.schaefer.sceurope.eu:

    Thanks for reply.. its help me.
Related