I'm very new to python but i will try to explain. I have a input like this 1234567890
and i want it to be more readable when it is a larger number and i want it to be formatted like this 1,234,567,890
.
from datetime import datetime
def price_calc():
the_item = 38
amount_of_the_item = input("Amount of items: ") #This output is what i want to change.
price = ((int(amount_of_the_item)) * (int(the_item)))
print("{:,}".format(price),"USD")
now = datetime.now()
t = now.strftime("%H:%M:%S")
print("Time", t)
while True:
price_calc()
Right now I get this from the console:
Amount of items: 1234567890
46,913,579,820 USD
Time 01:22:29
But I want to get this instead:
Amount of items: 1,234,567,890
46,913,579,820 USD
Time 01:22:29
and the first line of the console output is what I want to change.