Book Image

Programming Microsoft Dynamics??? NAV 2015

Book Image

Programming Microsoft Dynamics??? NAV 2015

Overview of this book

Table of Contents (19 chapters)
Programming Microsoft Dynamics™ NAV 2015
Credits
Foreword
About the Authors
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Data conversion and formatting functions


Some data type conversions are handled in the normal process flow by NAV without any particular attention on part of the Developer (for example, Code to Text, Char to Text). Some data type conversions can only be handled through C/AL functions. Formatting is included because it can also include a data type conversion. Rounding does not do a data type conversion, but does result in a change in format (the number of decimal places).

  • ROUND function

  • FORMAT function

  • EVALUATE function

ROUND

The ROUND function allows us to control the rounding precision for a decimal expression. The syntax for the ROUND function is as follows:

DecimalResult := ROUND (Number [, Precision] [, Direction] )

Here, Number is what is being rounded, Precision spells out the number of digits of decimal precision, and Direction indicates whether to round up, round down, or round to the nearest number. Some examples of Precision values are as follows:

Precision value

Rounding effect

...