Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function roundtopercent(val)
- local num,dec = math.modf(val * 100)
- if dec >= 0.5 then
- local solution = math.ceil(val * 100)
- return (solution .. "%")
- else
- local solution = math.floor(val * 100)
- return (solution .. "%")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement