PrecisionCalc
xl
Precision
Get Your Numbers Right

 

xlpROUND

Rounds a number to the specified number of digits, with up to 32,767 significant digits of precision. Same as Excel's built-in ROUND function, but with high precision.

Syntax

xlpROUND(num,num_digit,format_negative,format_thousands,format_currency,exponential_notation)

num Required. The number to be rounded.
num_digit Required. The number of digits to which to round num.
format_negative Optional. Determines whether negatives are formatted with a leading hyphen ("-"), or parentheses ("()"). Set to 1 to format negatives with a leading hyphen. Set to 2 for parentheses. 1 by default.

You can also format negatives with a red font.

format_thousands Optional. Determines whether thousands separators are included. Set to TRUE to include thousands separators. FALSE by default.
format_currency Optional. Determines whether currency symbol is included. Set to TRUE to include currency symbol. The currency symbol will be added either to the beginning or to the end of the result, whichever is appropriate for the locale. FALSE by default.
exponential_notation Optional. Determines whether result is formatted in exponential notation. Set to TRUE to format in exponential notation. FALSE by default.

Remarks

Examples

Formula Description Result
=xlpROUND(345.678,3) 345.678 rounded to three decimal places. 345.678
=xlpROUND(345.678,2) 345.678 rounded to two decimal places. 345.68
=xlpROUND(345.678,1) 345.678 rounded to one decimal place. 345.7
=xlpROUND(345.678,0) 345.678 rounded to an integer (rounded to last digit to the left of the decimal). 346
=xlpROUND(345.678,-1) 345.678 rounded to one place to the left of the last digit to the left of the decimal. 350
=xlpROUND(345.678,-2) 345.678 rounded to two places to the left of the last digit to the left of the decimal. 300
=xlpROUND(345.678,-3) 345.678 rounded to three places to the left of the last digit to the left of the decimal. 0
=xlpROUND(-345.678,2) -345.678 rounded to two decimal places. -345.68
=xlpROUND(-345.678,0) -345.678 rounded to an integer (rounded to last digit to the left of the decimal). -346
=xlpROUND(-345.678,-2) -345.678 rounded to two places to the left of the last digit to the left of the decimal. -300
=xlpROUND(345.678,2.999) 345.678 rounded to two decimal places (num_digits is truncated to 2, not rounded to 3). 345.68
=xlpROUND(345.678,2,,,,TRUE) 345.678 rounded to two decimal places and formatted in exponential notation. 3.4568E+2
=xlpROUND(A1,A2,2,TRUE,TRUE) A1 rounded to A2 digits, formatted with parentheses (if negative), thousands separators, and currency symbol.

See Also

xlpEVEN
xlpINT
xlpODD
xlpROUNDUP
xlpROUNDDOWN
xlpTRUNC