function to add zeros to a number > string

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 :)

views:1349 update:2011/9/26 8:07:09
corona forums © 2003-2011