Sha256: 1d3fefbec9fad42ad873ee609721bc0f7e641d26c9cd4614739fa3dfc8f169b0
Contents?: true
Size: 618 Bytes
Versions: 4
Compression:
Stored size: 618 Bytes
Contents
# * George Moschovitis <gm@navel.gr> # (c) 2004-2005 Navel, all rights reserved. # $Id: number.rb 74 2005-05-24 07:29:50Z gmosx $ module Glue; # Implement as a module to avoid class polution. You can # still use Ruby's advanced features to include the module in your # class. Passing the object to act upon allows to check for nil, # which isn't possible if you use self. module NumberUtils # Returns the multiple ceil of a number def self.ceil_multiple(num, multiple) # gmosx: to_f is needed! # gmosx: IS THERE a more optimized way to do this? return ((num.to_f/multiple).ceil*multiple) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
glue-0.18.0 | lib/glue/number.rb |
glue-0.19.0 | lib/glue/number.rb |
glue-0.20.0 | lib/glue/number.rb |
glue-0.18.1 | lib/glue/number.rb |