HI,
does anyone have a already made function to add zeros after a comma.
like addzeros (number,amount) where number is the orgnumber and amount the zeros needed after comma
so addzeros (5,3) gives 5.000
or addzeros (34.1,2) gives 34.10
:)
thx
chris
Ok :) as often after i submit my question 5 mins later i find the solution.
for everyone else:
function addzeros (amount,aftercomma)
return string.format("%." .. aftercomma .. "f", amount)
end
addzeros (12,3) = 12.000
addzeros (5.3,2) = 5.30
just had to find the lua string.format function :)