Difference between revisions of "Round"

From MiniScript Wiki
Jump to navigation Jump to search
(See also: floor - formatting)
Line 10: Line 10:
 
| ''x'' || number || number to round
 
| ''x'' || number || number to round
 
|}
 
|}
 
=== Usage Notes ===
 
<c>round</c> may be called either as a global method, passing the sequence or map as an argument; or as a member function (defined on [[list]], [[string]], and [[map]]) using [[dot syntax]], with no arguments.
 
  
 
== Examples ==
 
== Examples ==
Line 22: Line 19:
  
 
* [[floor]]
 
* [[floor]]
 +
* [[ceil]]
  
  
 
[[Category:Intrinsic Functions]]
 
[[Category:Intrinsic Functions]]
 
[[Category:Numeric Functions]]
 
[[Category:Numeric Functions]]

Revision as of 15:12, 25 March 2022

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


Arguments

Parameter Name Default Value Meaning
x number number to round

Examples

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

See also