class FastXlsToHash::Converter

Constants

CHAR

Public Class Methods

to_characters(num) click to toggle source
# File lib/fast_xls_to_hash/convert_number_to_xls_column/number_to_xls_column.rb, line 5
def self.to_characters(num)
  num += 1
  result = ''
  while(num > 0)
    num -= 1
    rest = num % 26
    num  = num / 26
    result += CHAR[rest]
  end
  result.reverse
end