我有一个数字形式(如何从电子表格中解析):
4.10045710008e+12 <type 'float'>
我如何将其转换为整数:
4100457100080
f = 4.10045710008e+12
i = int(f)
也更简单
a=int(4.10045710008e+12)
if type(value) == float:
value = int(value)
>>> f = 4.10045710008e+12
>>> type(f)
<type 'float'>
>>> int(f)
4100457100080L
>>>