User Tools

Site Tools


en:round

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:round [2020/04/21 21:18]
admin created
en:round [2020/04/21 21:26] (current)
admin [Description]
Line 3: Line 3:
 ==== Format ==== ==== Format ====
  
-**round** ( [[numericexpressions|Numeric_expression]] )+**round** ( [[numericexpressions|Numeric_expression]] )\\ 
 +**round** ( [[numericexpressions|Numeric_expression]], [[numericexpressions|Integer_expression]] )\\
  
-return [[booleanexpressions|boolean_expression]]+ 
 +return [[numericexpressions|Numeric_expression]]
  
 ==== Description ==== ==== Description ====
  
-The IsNumeric function returns true if the expression is an integer, a floating point number, or if it is a string that can be directly converted to a number.  Otherwise it returns false.+This function rounds a floating point number.  The optional second argument (an integer) defines how many decimal places to round to. 
 + 
 +==== Example ====
  
-The following Numeric strings are valid: "123", "-345", "234.234324""-34234.123""-2.567e7"and "6.7888E-8"+<code> 
 +a = 3.1415926535 
 +print round(a) 
 +print round(a,1) 
 +print round(a,2
 +print round(a,3) 
 +print round(a,4) 
 +</code> 
 +<code> 
 +3.0 
 +3.1 
 +3.14 
 +3.142 
 +3.1416 
 +</code>
  
 ==== See Also ==== ==== See Also ====
en/round.1587525535.txt.gz · Last modified: 2020/04/21 21:18 by admin