Rounding Functions Explained

0

In FileMaker there are a few different rounding functions that you may want to consider. Each one is different, but with some similarities. Read below to see the rounding functions explained. The information is taken from the FileMaker help site.

Ceiling

Purpose

Returns a number rounded up to the next integer.

Format

Ceiling(number)

Parameters

number – any numeric expression or field containing a numeric expression

Floor

Purpose

Returns a number rounded down to the next lower integer.

Format

Floor(number)

Parameters

number – any numeric expression or field containing a numeric expression

Int

Purpose

Drops digits to the right of the decimal point and returns the integer part of a number without rounding.

Format

Int(number)

Parameters

number – any numeric expression or field containing a numeric expression

Round

Purpose

Returns a number rounded to the specified precision (number of decimal places).

Format

Round(number;precision)

Parameters

number – any numeric expression or field containing a numeric expression
precision – any numeric expression or field containing a numeric expression

Description

If you round a negative number of decimal places, all digits to the right of the decimal point are dropped, and the number is rounded to the nearest tens, hundreds, and so on. The Round function always rounds up at 0.5.

Truncate

Purpose

Returns a number truncated to the specified number of decimal places.

Format

Truncate(number;precision)

Parameters

number – any numeric expression or field containing a numeric expression
precision – any numeric expression or field containing a numeric expression for the number of decimal places.

Description

This function doesn’t evaluate digits beyond the specified precision. Use the Round function to round up or down to the required precision.

 

Results Comparison

Number Ceiling ( Number ) Floor ( Number ) Int ( Number ) Round ( Number ; 0 ) Truncate ( Number ; 0 )
20.3 21 20 20 20 20
0.5 1 0 0 1 0
56.2 57 56 56 56 56

 

Free Download

Download this little FileMaker database to see the calculations at work. A great example for beginners!

Download “Rounding Functions” Rounding-Functions.zip – Downloaded 67 times – 289 KB

Leave a Reply