def write_number(*args)
    # Check for a cell reference in A1 notation and substitute row and column
    args = row_col_notation(args)

    return -1 if args.size < 3                # Check the number of args

    record  = 0x0203                          # Record identifier
    length  = 0x000E                          # Number of bytes to follow

    row     = args[0]                         # Zero indexed row
    col     = args[1]                         # Zero indexed column
    num     = args[2]
    xf      = xf_record_index(row, col, args[3]) # The cell format

    # Check that row and col are valid and store max and min values
    return -2 if check_dimensions(row, col) != 0

    header = [record, length].pack('vv')
    data   = [row, col, xf].pack('vvv')
    xl_double = [num].pack("d")

    xl_double.reverse! if @byte_order

    # Store the data or write immediately depending on the compatibility mode.
    store_with_compatibility(row, col, header + data + xl_double)

    0
  end
def write_number(*args)
    # Check for a cell reference in A1 notation and substitute row and column
    args = row_col_notation(args)

    return -1 if args.size < 3                # Check the number of args

    record  = 0x0203                          # Record identifier
    length  = 0x000E                          # Number of bytes to follow

    row     = args[0]                         # Zero indexed row
    col     = args[1]                         # Zero indexed column
    num     = args[2]
    xf      = xf_record_index(row, col, args[3]) # The cell format

    # Check that row and col are valid and store max and min values
    return -2 if check_dimensions(row, col) != 0

    header = [record, length].pack('vv')
    data   = [row, col, xf].pack('vvv')
    xl_double = [num].pack("d")

    xl_double.reverse! if @byte_order

    # Store the data or write immediately depending on the compatibility mode.
    store_with_compatibility(row, col, header + data + xl_double)

    0
  end
:call-seq:
   write_number(row, col,    token[, format])
   write_number(A1_notation, token[, format])

 Write a double to the specified row and column (zero indexed).
 An integer can be written as a double. Excel will display an
 integer. $format is optional.

 Returns  0 : normal termination
         -1 : insufficient number of arguments
         -2 : row or column out of range

 Write an integer or a float to the cell specified by row and column

    worksheet.write_number(0, 0,  123456)
    worksheet.write_number('A2',  2.3451)

 See the note about "Cell notation". The format parameter is optional.

 In general it is sufficient to use the write() method.