Decimal Vs. Whole Number

Is there a function I can call that will tell me if the contents of a decimal field is a whole number or a decimal? Simon

Try EVALUATE. Here’s a snippet of code : 1/ Create a Function called DecToInt and paste this code : IF NOT EVALUATE (intYourInteger, FORMAT (decYourDecimal) ) THEN MESSAGE (‘Cannot Cast Decimal %1 into integer %2’, decYourDecimal, intYourInteger) ELSE MESSAGE(‘casting successful!’); 2/ You can test my function like this : decYourDecimal := 5; DectoInt; decYourDecimal := 3.14978; DectoInt; tarek_demiati@ureach.com

Sorry! Sorry!, my brain ain’t good at executing code C/AL code today! :slight_smile: IF NOT EVALUATE (intYourInteger, FORMAT (decYourDecimal) ) THEN MESSAGE (‘Cannot Cast Decimal %1 into an Integer’,decYourDecimal) ELSE MESSAGE(‘casting successful!’); I hope the error message returned is now a little less stupid. tarek_demiati@ureach.com

Come on Guys If ROUND(Amount,1)<>Amount THEN Message(‘It’s Not Whole’); Mr David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk