As I understand it, you only want the 'most significant' part. To do so, use floor(log10(abs(n))) to get number of digits and then go from there. Something like this, maybe:
import math
def millify(n):
millnames=['','Thousand','Million','Billion','Trillion']
millidx=max(0,min(len(millnames)-1,
int(math.floor(math.log10(abs(n))/3.0))))
return '%.0f %s'%(n/10**(3*millidx),millnames[millidx])
Running the above function for a bunch of different numbers:
for n in (1.23456789*10**r for r in range(-1,19,2)):
print '%20.1f: %20s'%(n,millify(n))
0.1: 0
12.3: 12
1234.6: 1 Thousand
123456.8: 123 Thousand
12345678.9: 12 Million
1234567890.0: 1 Billion
123456789000.0: 123 Billion
12345678900000.0: 12 Trillion
1234567890000000.0: 1235 Trillion
123456788999999984.0: 123457 Trillion