python format

brl=1/2.43
format(brl,'0.4f')#只显示小数点后4位
format(2/3,'.1%’)#显示小数点后一位,百分数

 

posted @ 2020-08-11 17:22  猫七的blog  阅读(91)  评论(0编辑  收藏  举报