Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step tutorials and online videos.

Click Here To Learn More »

9.06 Math Functions

Math Functions

Table 9-8. Math Functions

Function Name Description
Abs(number) Return the absolute value.
Fix(number, decimals) Return a number with a specified number of significant digits.
Int(number), numerator \ denominator Return the integer portion of a fractional number.
Pi 3.14…
Remainder(numerator, denominator), Return the remainder of dividing the numerator by the denominator.
numerator Mod denominator Return the remainder of dividing the numerator by the denominator.
Round(number, decimals) Round up a number with a specified number of significant digits.
Sgn(number) Return number’s sign.
Sqr(number), Exp(number), Log(number) The standard arithmetic functions.
Cos(number), Sin(number), Tan(number), Atn(number) The standard scientific functions.

The math functions listed in Table 9-8 are similar to the corresponding functions in .NET. There are only a couple of interesting points to notice.

Working with whole numbers and decimals is done numerous ways. The Fix() and Round() functions take a fractional number and truncate it to a specified number of digits. The Round() function will round up to the nearest decimal. The number of decimals to display is optional and the default is zero. The Int() function is similar to the Round() function except that it only returns the whole number and will round down to the nearest whole number. Table 9-9 shows how the three functions will return a different number depending upon the decimal portion and whether the number is positive...

Get UNLIMITED Crystal Reports Online Training!

Click Here To Start Your Training!

1500+ Tutorial Pages

Complete Crystal Reports Online Training with over 1,500 pages of better than book quality Crystal Reports tutorials.

Step-by-step Online Videos

Learn at your own pace from the comfort of your home! Pause, rewind and watch online training videos anytime!

Online Community

Members-only community where you can post and answer questions. The community is checked on a regular basis by best selling Crystal Reports book author Brian Bischof to help answer your questions.

Cut & Paste Source Code

Save time with simple cut and paste source code you can use right now in your next report!

Click Here To Start Your Training!