I'm working on a free ticket printing machine which means I need to store money values. The problem is that if I buy a ticket priced 2.50 then Roblox displays that as "2.5". That's fine for the internal math bit but when I'm displaying the balance on the screen I want it to always have 2 decimal places.
--The balance is 100
local ticketPrice = 2.5
local balance = tonumber(Hit.Parent.balance.Value)
local balanceRemains = balance - ticketPrice
local balanceRemainsString = tostring(balanceRemains)
--Currently this would output 97.5 but I'm trying to get it to output 97.50
I've been looking at rounding and stuff but I can't find articles that are about money, most people want to round multiple decimal places into fewer but I don't have multiple. Thanks for the help!

1 comment
Thank you this works perfectly!