Method: GoogleDrive::Worksheet#numeric_value

Defined in:
lib/google_drive/worksheet.rb

#numeric_value(*args) ⇒ Object

Returns the numeric value of the cell. Arguments must be either (row number, column number) or cell name. Top-left cell is [1, 1].

e.g.

worksheet[1, 3]                #=> "3,0" # it depends on locale, currency...
worksheet.numeric_value(1, 3)  #=> 3.0

Returns nil if the cell is empty or contains non-number.

If you modify the cell, its numeric_value is nil until you call save() and reload().

For details, see: developers.google.com/google-apps/spreadsheets/#working_with_cell-based_feeds



134
135
136
137
138
# File 'lib/google_drive/worksheet.rb', line 134

def numeric_value(*args)
  (row, col) = parse_cell_args(args)
  reload() if !@cells
  return @numeric_values[[row, col]]
end