Sha256: a5ff060bc0058bd24bd45f12a1683aba6d85c9912b104c1b9aaa8be22e866eaf

Contents?: true

Size: 629 Bytes

Versions: 3

Compression:

Stored size: 629 Bytes

Contents

# * George Moschovitis  <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
# $Id: number.rb 182 2005-07-22 10:07: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

3 entries across 3 versions & 1 rubygems

Version Path
glue-0.21.2 lib/glue/number.rb
glue-0.22.0 lib/glue/number.rb
glue-0.21.0 lib/glue/number.rb