Round: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 32: Line 32:


[[Category:Language Reference]]
[[Category:Language Reference]]
[[Category:Math]]

Revision as of 18:02, 24 August 2012

Round(number[, fractionaldigits])

Description

Round returns a number that has been rounded to the specified number of decimal places. The required argument, number, is any valid numeric expression. The optional argument, fractionaldigits, is the number of decimal places included in the rounding; if fractionaldigits is not provided it defaults to 0 and Round returns integers.

Example

Rem Round Example
'Round rounds numbers to a given decimal place
Dim Pi, Pure, Ate
Pi = Round(3.14159265, 4)
Print Pi
Pure = Round(99.4444, 2)
Print Pure
Ate = Round(Sqr(69))
Print Ate

Output

3.1416
99.44
8

Related Items

Int, Fix