Book Image

Programming Microsoft Dynamics NAV 2013 - Third Edition

Book Image

Programming Microsoft Dynamics NAV 2013 - Third Edition

Overview of this book

Microsoft Dynamics NAV 2013 is a complete and robust ERP system that is accompanied by a comprehensive set of development tools. You will learn how to master these tools and tailor Microsoft Dynamics NAV 2013 to meet your customer's specific business needs."Programming Microsoft Dynamics® NAV 2013" will lead you from start to finish, teaching you how to use this incredible ERP software whilst simultaneously making you a more productive developer. You'll learn how to implement your solutions, as well as evaluating, managing and appraising Dynamics NAV 2013 productions and projects.You will be empowered with the skills and knowledge that you need to get the job done and exceed your client's expectations. Step by step, you will learn how to use NAV, master the C/AL programming language, as well as the construction and uses of each object type. Ultimately, you will be able to bring your NAV 2013 solution together with fantastic efficiency.Hands-on development examples and additional material teach you by example and uncover the insider knowledge that only years of experience can provide, truly unleashing your productivity and potential.
Table of Contents (19 chapters)
Programming Microsoft Dynamics NAV 2013
Credits
Foreword
About the Authors
Acknowledgements
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, and so on. 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 perform a data type conversion but does result in a change in format (the number of decimal places). These C/AL functions are:

  • ROUND

  • FORMAT

  • EVALUATE

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. The following table shows some examples of Precision values:

Precision value...