Sha256: 7729935221f7fdf7cbe2bdd80963ab45edc02465f04d86f4b8666a30598fd438

Contents?: true

Size: 667 Bytes

Versions: 6

Compression:

Stored size: 667 Bytes

Contents

# code:
# * George Moschovitis  <gm@navel.gr>
#
# (c) 2004 Navel, all rights reserved.
# $Id: number.rb 167 2004-11-23 14:03:10Z gmosx $

module G;

# = 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

6 entries across 6 versions & 2 rubygems

Version Path
nitro-0.6.0 lib/glue/number.rb
nitro-0.5.0 lib/glue/number.rb
nitro-0.7.0 lib/glue/number.rb
og-0.5.0 lib/glue/number.rb
og-0.6.0 lib/glue/number.rb
og-0.7.0 lib/glue/number.rb