Navigation:  ThinBASIC Modules > Core (thinBasic Core Engine) > Numeric functions >

Round

Previous pageReturn to chapter overviewNext page

 

Description

 

Round a numeric value to a specified number of decimal places.

 

Syntax

 

n = Round(NumericExpression, nDecimals)

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

NumericExpression

Numeric

No

The numeric value to be rounded

nDecimals

Numeric

No

Number of decimal places to return in the rounded number

 

Remarks

 

ROUND function does not perform "common" rounding, but round-to-even method: 1.255 to 2 decimals is rounded as 1.26, while 1.245 to 2 decimals is rounded to 1.24 )

 

Restrictions

 

See also

 

Numeric Handling,

 

Examples