小编sta*_*own的帖子

如何在保留有效数字位数的同时在Python中读取“ 0.00”作为数字?

我如何将“ 0.00”转换为整数而不invalid literal for int() with base 10: '0.00'出错?

这是我当前的代码;

a = int('0.00')        # which gives me an error
a = int(float('0.00')) # gives me 0, not the correct value of 0.00
Run Code Online (Sandbox Code Playgroud)

任何建议,将不胜感激!

python python-3.x

-8
推荐指数
1
解决办法
66
查看次数

标签 统计

python ×1

python-3.x ×1