Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 python 编程的新手,我想将输入的浮点数转换为输出精度为 10 或更少(数字的总位数)并缩放为 1(小数点后的数字)。我怎样才能在python中实现它。
>>> float(raw_input("Enter price:")) User price:6738882993.98888888373333 6738882993.988889 >>>
谢谢
盒马
为了让你需要十进制类型,而不是浮点类型。