Sha256: 1d37e0ce1bc2526d3e2e64b0135779a0937098027b91717f7a89ef6f8d709518

Contents?: true

Size: 618 Bytes

Versions: 3

Compression:

Stored size: 618 Bytes

Contents

# * George Moschovitis  <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
# $Id: number.rb 282 2005-03-10 12:24:53Z gmosx $

module N;

# 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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
glue-0.13.0 lib/glue/number.rb
glue-0.15.0 lib/glue/number.rb
glue-0.14.0 lib/glue/number.rb