Difference between revisions of "Round"
Jump to navigation
Jump to search
(Created page with "<c>round</c> rounds a number to the specified number of decimal places. === Arguments === {| class="wikitable" |- ! Parameter Name !! Default Value !! Meaning |- | ''x'' ||...") |
|||
Line 14: | Line 14: | ||
<c>funcname</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. | <c>funcname</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 == |
<ms>Example: round(pi, 2) // returns 3.14 | <ms>Example: round(pi, 2) // returns 3.14 |
Revision as of 16:03, 17 March 2020
round
rounds a number to the specified number of decimal places.
Arguments
Parameter Name | Default Value | Meaning |
---|---|---|
x | number | number to round |
Usage Notes
funcname
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
Example: round(pi, 2) // returns 3.14
round(12345, -3) // returns 12000