Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def rounders(value)
- string = value.to_s
- string_length = string.length
- x = 1
- if string[string_length - 1] <= '4' then
- value = value.round -(string_length - 1)
- else
- while (x <= string_length - 1)
- value = value.round(-x)
- x = x + 1
- end
- end
- return value
- end
Advertisement
Add Comment
Please, Sign In to add comment