开发者

Getting float=04 out of int=4

开发者 https://www.devze.com 2023-01-10 23:35 出处:网络
I need to convert integers into two decimal float开发者_如何学Python numbers. So if i have an integer 3 i want it to be float 03. But if i have an two digit integer 33, i want it to be float 33.The fl

I need to convert integers into two decimal float开发者_如何学Python numbers. So if i have an integer 3 i want it to be float 03. But if i have an two digit integer 33, i want it to be float 33.


The float value will always just be the actual number value. If you want to display that value and have to appear with a leading 0, you will have to use string formatting and the format options to produce "03" from a value of 3.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号