Python Add Comma Into Number String

前端 未结 9 1057
陌清茗
陌清茗 2020-11-29 02:37

Using Python v2, I have a value running through my program that puts out a number rounded to 2 decimal places at the end:

like this:

print (\"Total          


        
9条回答
  •  情歌与酒
    2020-11-29 03:24

    I feel comfortable using like this in python:

    input_value=float(input())
    print("{:,}".format(input_value))
    

提交回复
热议问题