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

:slight_smile:

thx
chris
[import]uid: 4795 topic_id: 14763 reply_id: 314763[/import]

Ok :slight_smile: 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 :slight_smile:

[import]uid: 4795 topic_id: 14763 reply_id: 54563[/import]