Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SevenMath Functions (continued)

Round Function

Overview

The Round function rounds a source value at an optional place using an optional rounding method.

Syntax/Parameters

Syntax

float = Round ( float x, [int place], [int mode] );

Parameters

x

A float as the source value to round.

place

An optional int specifying the position to round from. The default is 0, or whole numbers. Set the place to -2 for cents, or 3 for thousands.

mode

An optional int specifying the mode in which to round x. The default value is ROUND_NEAREST.

Return Value

Returns a float containing rounded number or 0.0 on failure. Use the IsError or GetLastError functions to determine if an error occurred.

Remarks

The Round function allows numbers to be rounded up or down based on the digits prior to the place parameter. The method is set by the mode and can be any of the following:

  Definition   Ordinal   Description  
  ROUND_NEAREST   0   Round Towards the Nearest  
  ROUND_UPWARD   1   Round towards Positive Infinity  
  ROUND_DOWNWARD   2   Round Towards Negative Infinity  
  ROUND_TOWARD_ZERO   3   Round Toward Zero  

 

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic

Page revised 2024-04-22