Rounding numbers? (Release Announcements)

by Jim ⌂ @, Russell, KY, Wednesday, November 20, 2013, 01:24 (1285 days ago) @ Aaron

No problem - just be more careful next time.

I would create a round function and use it like this:

input "enter a number> ", i
print i + " rounded is " + round(i)


function round(n)
# round a number n
if n > 0 then
n = n + .5
return floor(n)
else
n = n - .5
return ceil(n)
end if
end function


Complete thread:

 RSS Feed of thread

powered by my little forum