Meanders · Utilities
ME Round Number
ME Round · v0.1.0
Round numbers to a specified number of decimal places.
Number
N · number · list
Numbers to round.
Decimal Placesoptional
D · integer · item
Number of decimal places to keep.
ME Round
N
D
R
ME Round Number
Rounded
R · number · list
Rounded numbers.
Overview
Description
Rounds one or more numbers to a specified number of decimal places. Values exactly halfway between two results are rounded away from zero.
Input Parameters
Inputs
2 parameters
Number
NNumbers to round.
numberlist
Decimal Places
DoptionalNumber of decimal places to keep.
integeritem
Output Parameters
Outputs
1 parameter
Rounded
RRounded numbers.
numberlist
Usage
Examples
Round to two decimal places
Round a number to two decimal places.
Input
12.34567 with D = 2Output
12.35Round multiple numbers
Round a list of numbers using the same decimal-place setting.
Input
[12.345, 8.999, 3.14159] with D = 2Output
[12.35, 9.00, 3.14]Halfway values
Values exactly halfway between two results are rounded away from zero.
Input
1.125 with D = 2Output
1.13Additional Information
Notes
- Decimal Places defaults to 2.
- Decimal Places must be an integer between 0 and 15.
- Rounding uses MidpointRounding.AwayFromZero.
- The Number input accepts a list of numbers.
Validation
Errors
- !Decimal Places cannot be negative.
- !Decimal Places must be between 0 and 15.
- !Number cannot contain NaN or Infinity.
Explore More