首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
广告
V2EX
›
问与答
请问在 python3 中如何将 string 类型转换为 decimal.Decimal 类型?
panghua
·
2018-08-21 18:30:19 +08:00
· 3946 次点击
这是一个创建于 2420 天前的主题,其中的信息可能已经有所发展或是发生改变。
在 python3 中如何将 string 类型转换为 decimal.Decimal 类型
DECIMAL
string
Python3
类型
3 条回复
•
2018-11-12 17:31:05 +08:00
1
zjb861107
2018-08-21 18:35:26 +08:00
https://docs.python.org/3/library/decimal.html
2
panghua
OP
2018-08-22 11:59:35 +08:00
谢谢!
3
tqknight
2018-11-12 17:31:05 +08:00
import decimal
dec = decimal.Decimal('0.123456')
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
829 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms ·
UTC 20:25
·
PVG 04:25
·
LAX 13:25
·
JFK 16:25
Developed with
CodeLauncher
♥ Do have faith in what you're doing.