I'm trying to find a way to format a scientific number and save it into database. My number is read from a csv file.
for line in csvfile:
data = Doc()
invalid literal for int() with base 10: '2,02161E+12'
Your data is malformed. While the int('2,02161E+12') and float('2,02161E+12') would indeed produce that error float('2.02161E+12') would not. So the solution is
int( float('2,02161E+12'.replace(',','.)) )