Class: RubyXL::NumberFormats

Inherits:
OOXMLContainerObject show all
Defined in:
lib/rubyXL/objects/stylesheet.rb

Overview

Constant Summary collapse

DEFAULT_NUMBER_FORMATS =
self.new(:_ => [
  RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => '0'),
  RubyXL::NumberFormat.new(:num_fmt_id => 2, :format_code => '0.00'),
  RubyXL::NumberFormat.new(:num_fmt_id => 3, :format_code => '#, ##0'),
  RubyXL::NumberFormat.new(:num_fmt_id => 4, :format_code => '#, ##0.00'),
  RubyXL::NumberFormat.new(:num_fmt_id => 5, :format_code => '$#, ##0_);($#, ##0)'),
  RubyXL::NumberFormat.new(:num_fmt_id => 6, :format_code => '$#, ##0_);[Red]($#, ##0)'),
  RubyXL::NumberFormat.new(:num_fmt_id => 7, :format_code => '$#, ##0.00_);($#, ##0.00)'),
  RubyXL::NumberFormat.new(:num_fmt_id => 8, :format_code => '$#, ##0.00_);[Red]($#, ##0.00)'),
  RubyXL::NumberFormat.new(:num_fmt_id => 9, :format_code => '0%'),
  RubyXL::NumberFormat.new(:num_fmt_id => 10, :format_code => '0.00%'),
  RubyXL::NumberFormat.new(:num_fmt_id => 11, :format_code => '0.00E+00'),
  RubyXL::NumberFormat.new(:num_fmt_id => 12, :format_code => '# ?/?'),
  RubyXL::NumberFormat.new(:num_fmt_id => 13, :format_code => '# ??/??'),
  RubyXL::NumberFormat.new(:num_fmt_id => 14, :format_code => 'm/d/yyyy'),
  RubyXL::NumberFormat.new(:num_fmt_id => 15, :format_code => 'd-mmm-yy'),
  RubyXL::NumberFormat.new(:num_fmt_id => 16, :format_code => 'd-mmm'),
  RubyXL::NumberFormat.new(:num_fmt_id => 17, :format_code => 'mmm-yy'),
  RubyXL::NumberFormat.new(:num_fmt_id => 18, :format_code => 'h:mm AM/PM'),
  RubyXL::NumberFormat.new(:num_fmt_id => 19, :format_code => 'h:mm:ss AM/PM'),
  RubyXL::NumberFormat.new(:num_fmt_id => 20, :format_code => 'h:mm'),
  RubyXL::NumberFormat.new(:num_fmt_id => 21, :format_code => 'h:mm:ss'),
  RubyXL::NumberFormat.new(:num_fmt_id => 22, :format_code => 'm/d/yyyy h:mm'),
  RubyXL::NumberFormat.new(:num_fmt_id => 37, :format_code => '#, ##0_);(#, ##0)'),
  RubyXL::NumberFormat.new(:num_fmt_id => 38, :format_code => '#, ##0_);[Red](#, ##0)'),
  RubyXL::NumberFormat.new(:num_fmt_id => 39, :format_code => '#, ##0.00_);(#, ##0.00)'),
  RubyXL::NumberFormat.new(:num_fmt_id => 40, :format_code => '#, ##0.00_);[Red](#, ##0.00)'),
  RubyXL::NumberFormat.new(:num_fmt_id => 45, :format_code => 'mm:ss'),
  RubyXL::NumberFormat.new(:num_fmt_id => 46, :format_code => '[h]:mm:ss'),
  RubyXL::NumberFormat.new(:num_fmt_id => 47, :format_code => 'mm:ss.0'),
  RubyXL::NumberFormat.new(:num_fmt_id => 48, :format_code => '##0.0E+0'),
  RubyXL::NumberFormat.new(:num_fmt_id => 49, :format_code => '@')
])

Instance Method Summary collapse

Methods inherited from OOXMLContainerObject

#before_write_xml, define_count_attribute, #initialize, #inspect

Methods included from OOXMLObjectInstanceMethods

#==, #before_write_xml, included, #index_in_collection, #initialize, #write_xml

Constructor Details

This class inherits a constructor from RubyXL::OOXMLContainerObject

Instance Method Details

#find_by_format_id(format_id) ⇒ Object



63
64
65
# File 'lib/rubyXL/objects/stylesheet.rb', line 63

def find_by_format_id(format_id)
  self.find { |fmt| fmt.num_fmt_id == format_id }
end