gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
fivem lua I've got a number variable price = 100000 how could i automatically make it…
- User
fivem lua I've got a number variable
price = 100000
how could i automatically make it format with commas?
- Assistant
You can use the string.format function to automatically format the number with commas:
price = 100000 formatted_price = string.format("%d", price):reverse():gsub("(%d%d%d)","%1,"):reverse():gsub("^,", "") print(formatted_price)
This should output:
100,000