Converting exponential to float

前端 未结 6 1418
余生分开走
余生分开走 2020-12-18 08:55

This is my code, trying to convert the second field of the line from exponential into float.

outputrrd = processrrd.communicate()
(output, error) = outputrrd         


        
6条回答
  •  隐瞒了意图╮
    2020-12-18 09:27

    The easy way is replace! One simple example:

    value=str('6,0865000000e-01')
    value2=value.replace(',', '.')
    float(value2)
    0.60865000000000002
    

提交回复
热议问题