User Tools

Site Tools


en:round

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:round [2020/04/21 21:25]
admin
en:round [2020/04/21 21:26] (current)
admin [Description]
Line 11: Line 11:
 ==== Description ==== ==== Description ====
  
-This function rounds a floating point number.  The second argument should be an integer defining how many decimal places to round to.+This function rounds a floating point number.  The optional second argument (an integer) defines how many decimal places to round to.
  
 ==== Example ==== ==== Example ====
Line 24: Line 24:
 </code> </code>
 <code> <code>
-a = 3.1415926535 +3.0 
-print round(a) +3.
-print round(a,1) +3.14 
-print round(a,2) +3.142 
-print round(a,3) +3.1416
-print round(a,4)+
 </code> </code>
  
en/round.1587525922.txt.gz · Last modified: 2020/04/21 21:25 by admin