Class: NumberFormatRecord

Inherits:
BiffRecord show all
Defined in:
lib/surpass/biff_record.rb

Overview

Record FORMAT, BIFF8: Offset Size Contents 0 2 Format index used in other records 2 var. Number format string (Unicode string, 16-bit string length)

From BIFF5 on, the built-in number formats will be omitted. The built-in formats are dependent on the current regional settings of the operating system. The following table shows which number formats are used by default in a US-English environment. All indexes from 0 to 163 are reserved for built-in formats. The first user-defined format starts at 164.

The built-in number formats, BIFF5-BIFF8

Index Type Format string 0 General General 1 Decimal 0 2 Decimal 0.00 3 Decimal #,##0 4 Decimal #,##0.00 5 Currency “$”#,##0_);(“$”#,## 6 Currency “$”#,##0_);(“$”#,## 7 Currency “$”#,##0.00_);(“$”#,## 8 Currency “$”#,##0.00_);(“$”#,## 9 Percent 0% 10 Percent 0.00% 11 Scientific 0.00E+00 12 Fraction # ?/? 13 Fraction # ??/?? 14 Date M/D/YY 15 Date D-MMM-YY 16 Date D-MMM 17 Date MMM-YY 18 Time h:mm AM/PM 19 Time h:mm:ss AM/PM 20 Time h:mm 21 Time h:mm:ss 22 Date/Time M/D/YY h:mm 37 Account _(#,##0_);(#,##0) 38 Account _(#,##0_);(#,##0) 39 Account _(#,##0.00_);(#,##0.00) 40 Account _(#,##0.00_);(#,##0.00) 41 Currency _(“$”* #,##0_);_(“$”* (#,##0);_(“$”* “-”_);_(@_) 42 Currency _(* #,##0_);_(* (#,##0);_(* “-”_);_(@_) 43 Currency _(“$”* #,##0.00_);_(“$”* (#,##0.00);_(“$”* “-”??_);_(@_) 44 Currency _(* #,##0.00_);_(* (#,##0.00);_(* “-”??_);_(@_) 45 Time mm:ss 46 Time [h]:mm:ss 47 Time mm:ss.0 48 Scientific ##0.0E+0 49 Text @

Constant Summary collapse

RECORD_ID =
0x041E

Constants inherited from BiffRecord

BiffRecord::BIFF_LIMIT, BiffRecord::CONTINUE_RECORD_ID

Instance Attribute Summary

Attributes inherited from BiffRecord

#record_data

Instance Method Summary collapse

Methods inherited from BiffRecord

#record_header, #to_biff

Constructor Details

#initialize(index, format_string) ⇒ NumberFormatRecord

Returns a new instance of NumberFormatRecord.



670
671
672
# File 'lib/surpass/biff_record.rb', line 670

def initialize(index, format_string)
  @record_data = [index].pack('v') + mock_unicode_string(format_string)
end