Sha256: c0dd80384e16d35bd49520e01be3bad782592b811e772dc8c8849f95c8e7c28b

Contents?: true

Size: 426 Bytes

Versions: 13

Compression:

Stored size: 426 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require 'write_xlsx'

workbook  = WriteXLSX.new('keep_leading_zeros.xlsx')
worksheet = workbook.add_worksheet

worksheet.keep_leading_zeros(true)
worksheet.write('A1', '001')
worksheet.write('B1', 'written as string.')
worksheet.write('A2', '012')
worksheet.write('B2', 'written as string.')
worksheet.write('A3', '123')
worksheet.write('B3', 'written as number.')

workbook.close

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
write_xlsx-1.12.1 examples/keep_leading_zeros.rb
write_xlsx-1.12.0 examples/keep_leading_zeros.rb
write_xlsx-1.11.2 examples/keep_leading_zeros.rb
write_xlsx-1.11.1 examples/keep_leading_zeros.rb
write_xlsx-1.11.0 examples/keep_leading_zeros.rb
write_xlsx-1.10.2 examples/keep_leading_zeros.rb
write_xlsx-1.10.1 examples/keep_leading_zeros.rb
write_xlsx-1.10.0 examples/keep_leading_zeros.rb
write_xlsx-1.09.5 examples/keep_leading_zeros.rb
write_xlsx-1.09.4 examples/keep_leading_zeros.rb
write_xlsx-1.09.3 examples/keep_leading_zeros.rb
write_xlsx-1.09.2 examples/keep_leading_zeros.rb
write_xlsx-1.09.1 examples/keep_leading_zeros.rb