Skip to content

Commit 6deb722

Browse files
committed
Add Numeric#round
1 parent a79052a commit 6deb722

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

opal/corelib/numeric.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ def pred
316316
`self - 1`
317317
end
318318

319+
def round
320+
`Math.round(self)`
321+
end
322+
319323
def step(limit, step = 1, &block)
320324
return enum_for :step, limit, step unless block
321325

0 commit comments

Comments
 (0)