Sha256: 52121e5d19327d63cf55690879aecb0b0e5bf6ec3726abcc4c9958c93e631a27

Contents?: true

Size: 618 Bytes

Versions: 6

Compression:

Stored size: 618 Bytes

Contents

# * George Moschovitis  <gm@navel.gr>
# (c) 2004-2005 Navel, all rights reserved.
# $Id: number.rb 249 2005-02-04 14:03:00Z 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

6 entries across 6 versions & 2 rubygems

Version Path
nitro-0.12.0 lib/glue/number.rb
nitro-0.11.0 lib/glue/number.rb
nitro-0.10.0 lib/glue/number.rb
og-0.10.0 lib/glue/number.rb
og-0.11.0 lib/glue/number.rb
og-0.12.0 lib/glue/number.rb