Module spreadsheet_ods::format [−][src]
Defines ValueFormat for formatting related issues
use spreadsheet_ods::{ValueFormat, ValueType}; use spreadsheet_ods::format::FormatNumberStyle; let mut v = ValueFormat::new_with_name("dt0", ValueType::DateTime); v.push_day(FormatNumberStyle::Long); v.push_text("."); v.push_month(FormatNumberStyle::Long); v.push_text("."); v.push_year(FormatNumberStyle::Long); v.push_text(" "); v.push_hours(FormatNumberStyle::Long); v.push_text(":"); v.push_minutes(FormatNumberStyle::Long); v.push_text(":"); v.push_seconds(FormatNumberStyle::Long); let mut v = ValueFormat::new_with_name("n3", ValueType::Number); v.push_number(3, false);
The output formatting is a rough approximation with the possibilities offered by format! and chrono::format. Especially there is no trace of i18n. But on the other hand the formatting rules are applied by LibreOffice when opening the spreadsheet so typically nobody notices this.
Structs
AttrMap2 | Container type for attributes. |
FormatPart | One structural part of a value format. |
ValueFormat | Actual textual formatting of values. |
ValueFormatRef | Refers to a $l. |
Enums
FormatCalendarStyle | Calendar types. |
FormatNumberStyle | Flag for several PartTypes. |
FormatPartType | Identifies the structural parts of a value format. |
ValueFormatError |
Traits
AttrMap2Trait | Allows forwarding for structs that contain an AttrMap2 |
Functions
create_boolean_format | Creates a new number format. |
create_currency_prefix | Creates a new currency format. |
create_currency_suffix | Creates a new currency format. |
create_date_dmy_format | Creates a new date format D.M.Y |
create_date_mdy_format | Creates a new date format M/D/Y |
create_datetime_format | Creates a datetime format Y-M-D H:M:S |
create_number_format | Creates a new number format. |
create_number_format_fixed | Creates a new number format with a fixed number of decimal places. |
create_percentage_format | Creates a new percantage format.< |
create_time_format | Creates a new time-Duration format H:M:S |