Sha256: 8ef5c731e5b00f7dc508f959f4a49cd5ccf5482a754592d377298191c38c0581
Contents?: true
Size: 667 Bytes
Versions: 2
Compression:
Stored size: 667 Bytes
Contents
# code: # * George Moschovitis <gm@navel.gr> # # (c) 2004 Navel, all rights reserved. # $Id: number.rb 202 2005-01-17 10:44:13Z gmosx $ module N; # = NumberUtils # # === Design: # # 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!s # gmosx: IS THERE a more optimized way to do this? return ((num.to_f/multiple).ceil*multiple) end end end # module
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
nitro-0.9.3 | lib/glue/number.rb |
og-0.9.3 | lib/glue/number.rb |