Class: String

Inherits:
Object show all
Defined in:
lib/statsample.rb

Instance Method Summary collapse

Instance Method Details

#is_number?Boolean

Returns:

  • (Boolean)


35
36
37
38
39
40
41
# File 'lib/statsample.rb', line 35

def is_number?
  if self =~ /^-?\d+[,.]?\d*(e-?\d+)?$/
    true
  else
    false
  end
end