Difference between revisions of "Round"

From MiniScript Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<c>round</c> rounds a number to the specified number of decimal places.
 
<c>round</c> rounds a number to the specified number of decimal places.
  
 +
See also: [[floor]], [[ceil]]
  
 
=== Arguments ===
 
=== Arguments ===
Line 15: Line 16:
 
<ms>round(pi, 2)            // returns 3.14
 
<ms>round(pi, 2)            // returns 3.14
 
round(12345, -3)        // returns 12000</ms>
 
round(12345, -3)        // returns 12000</ms>
 
== See also ==
 
 
* [[floor]]
 
* [[ceil]]
 
 
  
 
[[Category:Intrinsic Functions]]
 
[[Category:Intrinsic Functions]]
 
[[Category:Numeric Functions]]
 
[[Category:Numeric Functions]]

Revision as of 15:13, 25 March 2022

round rounds a number to the specified number of decimal places.

See also: floor, ceil

Arguments

Parameter Name Default Value Meaning
x number number to round

Examples

round(pi, 2)             // returns 3.14
round(12345, -3)         // returns 12000