Class: ReeNumber::DigitCount

Inherits:
Object
  • Object
show all
Includes:
Ree::FnDSL
Defined in:
lib/ree_lib/packages/ree_number/package/ree_number/functions/digit_count.rb

Instance Method Summary collapse

Instance Method Details

#call(number) ⇒ Object



10
11
12
13
# File 'lib/ree_lib/packages/ree_number/package/ree_number/functions/digit_count.rb', line 10

def call(number)
  return 1 if number.zero?
  (Math.log10(number.abs) + 1).floor
end