python get float by specified precision

前端 未结 0 1619
难免孤独
难免孤独 2020-11-30 16:29

I need to get quantity number by specified precision like below.

qty = 0.1284
precision = 0.01
output = 0.12

It seems easy, buy I could not g

相关标签:
回答
  • 消灭零回复
提交回复
热议问题