Difference between revisions of "Manuals/calci/ROUND"

From ZCubes Wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
*'num_of_digits' is the number of digits before or after decimal point.
 
*'num_of_digits' is the number of digits before or after decimal point.
  
ROUND() rounds the number to specified number of digits.
+
ROUND() rounds a number to specified number of digits.
  
 
== Description ==
 
== Description ==
  
 
ROUND(number, num_of_digits)
 
ROUND(number, num_of_digits)
 +
 +
This function is used to round a number to certain number of digits mentioned in the argument.
  
 
For Example,
 
For Example,
  
ROUND(3.6712,2) ''returns 3.67''
+
ROUND(3.6712,2) ''returns 3.67'' as a result.
 +
 
 +
ROUND(411.3,-1) ''returns 410'' as a result.
 +
 
 +
*If 'num_of_digits' is omitted, Calci assumes it to be zero and rounds the number to the nearest integer.
 +
*The number is rounded to the specified number of decimal places, if num_of_digits > 0.
 +
*The number is rounded to the nearest integer, if num_of_digits = 0.
 +
*The number is rounded to the left of the decimal point, if num_of_digits < 0.
 +
*If any argument is non-numeric, Calci displays #NaN error message.
 +
 
 +
ROUND() can also be used for multiple number array as -
 +
 
 +
ROUND(2.5..6..0.5) that rounds the numbers from 2.5 to 6 in steps of 0.5.
  
*When Nd is greater than zero,the number is rounded to the specified number of decimal places.
 
*When  Nd is 0, the number is rounded to the nearest integer.
 
*When Nd  is less than 0, the number is rounded to the left of the decimal point.
 
  
  

Revision as of 13:38, 27 November 2013

ROUND(number, num_of_digits)

  • Where 'number' is the number to round and
  • 'num_of_digits' is the number of digits before or after decimal point.

ROUND() rounds a number to specified number of digits.

Description

ROUND(number, num_of_digits)

This function is used to round a number to certain number of digits mentioned in the argument.

For Example,

ROUND(3.6712,2) returns 3.67 as a result.

ROUND(411.3,-1) returns 410 as a result.

  • If 'num_of_digits' is omitted, Calci assumes it to be zero and rounds the number to the nearest integer.
  • The number is rounded to the specified number of decimal places, if num_of_digits > 0.
  • The number is rounded to the nearest integer, if num_of_digits = 0.
  • The number is rounded to the left of the decimal point, if num_of_digits < 0.
  • If any argument is non-numeric, Calci displays #NaN error message.

ROUND() can also be used for multiple number array as -

ROUND(2.5..6..0.5) that rounds the numbers from 2.5 to 6 in steps of 0.5.



Examples

Function Output
3.6712 2
3.67