lib/style.rb in surpass-0.0.3 vs lib/style.rb in surpass-0.0.4
- old
+ new
@@ -95,9 +95,23 @@
# Store the 6 parameters of the default_style
@default_format = add_style(@default_style)[0]
end
+### @export "autoformats"
+ def default_date_style
+ @default_date_style ||= StyleFormat.new(:number_format_string => 'dd-mmm-yyyy')
+ end
+
+ def default_datetime_style
+ @default_datetime_style ||= StyleFormat.new(:number_format_string => 'dd-mmm-yyyy hh:mm:ss')
+ end
+
+ def default_float_style
+ @default_float_style ||= StyleFormat.new(:number_format_string => '#,##0.00')
+ end
+### @end
+
def add(style)
if style.nil?
0x10 # Return the index of the default style.
else
add_style(style)[1] # Return the index of the style just stored.