Thread
:
Converting floats
View Single Post
#
2
12-20-2011, 03:47 PM
farshizzo
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
You can use the
round
function to round a floating point number to the nearest integer value:
Code:
value = 5.3 if round(value) == 5.0: print 'Is equal to 5'
If you want the integer component without rounding, then you can use the
int
function.
farshizzo
View Public Profile
Find all posts by farshizzo