NumFormat class sealed Number Formats

Base class for number formats that control how cell values are displayed.

Implementers

Properties

formatCode String
The Excel format code string that controls how the value is displayed.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

accepts(CellValue? value) bool
Whether value can be displayed with this format.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String v) CellValue
Parses the raw stored string v into the CellValue this format represents.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

custom({required String formatCode}) CustomNumFormat
Creates a custom number format from formatCode, inferring whether it is a date/time or numeric format from the code.
defaultFor(CellValue? value) NumFormat
Returns the default format appropriate for value's runtime type.

Constants

defaultBool → const StandardNumericNumFormat
The default format for boolean values (standard_0, General).
defaultDate → const StandardDateTimeNumFormat
The default format for date values (standard_14).
defaultDateTime → const StandardDateTimeNumFormat
The default format for date-time values (standard_22).
defaultFloat → const StandardNumericNumFormat
The default format for floating-point values (standard_2, 0.00).
defaultNumeric → const StandardNumericNumFormat
The default format for integer values (numeric standard_1).
defaultTime → const StandardTimeNumFormat
The default format for time values (standard_20).
standard_0 → const StandardNumericNumFormat
Standard format 0: the General format (no specific formatting).
standard_1 → const StandardNumericNumFormat
Standard format 1: integer with no decimals (0).
standard_2 → const StandardNumericNumFormat
Standard format 2: number with two decimals (0.00).
standard_3 → const StandardNumericNumFormat
Standard format 3: thousands-separated integer (#,##0).
standard_4 → const StandardNumericNumFormat
Standard format 4: thousands-separated number with two decimals (#,##0.00).
standard_9 → const StandardNumericNumFormat
Standard format 9: percentage with no decimals (0%).
standard_10 → const StandardNumericNumFormat
Standard format 10: percentage with two decimals (0.00%).
standard_11 → const StandardNumericNumFormat
Standard format 11: scientific notation (0.00E+00).
standard_12 → const StandardNumericNumFormat
Standard format 12: single-digit fraction (# ?/?).
standard_13 → const StandardNumericNumFormat
Standard format 13: two-digit fraction (# ??/??).
standard_14 → const StandardDateTimeNumFormat
Standard format 14: short date (mm-dd-yy).
standard_15 → const StandardDateTimeNumFormat
Standard format 15: day, abbreviated month and year (d-mmm-yy).
standard_16 → const StandardDateTimeNumFormat
Standard format 16: day and abbreviated month (d-mmm).
standard_17 → const StandardDateTimeNumFormat
Standard format 17: abbreviated month and year (mmm-yy).
standard_18 → const StandardTimeNumFormat
Standard format 18: 12-hour time with AM/PM (h:mm AM/PM).
standard_19 → const StandardTimeNumFormat
Standard format 19: 12-hour time with seconds and AM/PM (h:mm:ss AM/PM).
standard_20 → const StandardTimeNumFormat
Standard format 20: 24-hour time (h:mm).
standard_21 → const StandardTimeNumFormat
Standard format 21: 24-hour time with seconds (h:mm:dd).
standard_22 → const StandardDateTimeNumFormat
Standard format 22: date and time (m/d/yy h:mm).
standard_37 → const StandardNumericNumFormat
Standard format 37: thousands-separated integer with parenthesized negatives (#,##0 ;(#,##0)).
standard_38 → const StandardNumericNumFormat
Standard format 38: thousands-separated integer with red parenthesized negatives (#,##0 ;[Red](#,##0)).
standard_39 → const StandardNumericNumFormat
Standard format 39: two-decimal number with parenthesized negatives (#,##0.00;(#,##0.00)).
standard_40 → const StandardNumericNumFormat
Standard format 40: two-decimal number with red parenthesized negatives (#,##0.00;[Red](#,#)).
standard_45 → const StandardTimeNumFormat
Standard format 45: minutes and seconds (mm:ss).
standard_46 → const StandardTimeNumFormat
Standard format 46: elapsed hours, minutes and seconds ([h]:mm:ss).
standard_47 → const StandardTimeNumFormat
Standard format 47: minutes, seconds and tenths (mmss.0).
standard_48 → const StandardNumericNumFormat
Standard format 48: number in thousands with one decimal (##0.0).
standard_49 → const StandardNumericNumFormat
Standard format 49: text (@).