How do I split a floating point number.
For example :
1.24345 would return 24345
1455.24 would return 24
1455.0 would return 0
Edit :
My solution inspired by Nick ODell. This is oriented specifically toward the Tkinter Text widget.
index = '140.2020'
split = index.split('.')
nindex = [int(i) for i in split]
print nindex
Assuming that ‘index’ is a string since you are dealing with a text widget index:
If you really do have a floating point number, you need to convert it to a string first: