python cast decimal string to int code example
Example 1: python string to int
# Use the function int() to turn a string into an integer
string = '123'
integer = int(string)
integer
# Output:
# 123
Example 2: decimal to int python
print "%.4f" % 3.3333333333
3.3333
print "%.4f" % 6.6666666666
6.6667