HumanNumberPrinter<T extends num> class
Prints numbers in a custom human readable string.
Constructors
-
HumanNumberPrinter.new({required List<
String> units, int base = 10, List<String> characters = NumeralSystem.latin, String delimiter = delimiterString, String infinity = infinityString, String nan = nanString, int padding = 0, int precision = 0, String separator = '', int separatorWidth = 3, int separatorOffset = 0, Printer<double> ? sign, int unitBase = 10, int unitOffset = 0, int unitPrecision = 0, bool unitPrefix = false, String unitSeparator = ' '}) - Prints numbers in a custom human readable string.
-
HumanNumberPrinter.binary({int base = 10, List<
String> characters = NumeralSystem.latin, String delimiter = delimiterString, String infinity = infinityString, bool long = false, String nan = nanString, int padding = 0, int precision = 0, String separator = '', int separatorWidth = 3, int separatorOffset = 0, int unitPrecision = 0, Printer<double> ? sign, bool unitPrefix = false, String unitSeparator = ' '}) -
Prints numbers using a binary suffix for units in data processing, data
transmission, and digital information.
factory
-
HumanNumberPrinter.decimal({int base = 10, List<
String> characters = NumeralSystem.latin, String delimiter = delimiterString, String infinity = infinityString, bool long = false, String nan = nanString, int padding = 0, int precision = 0, String separator = '', int separatorWidth = 3, int separatorOffset = 0, Printer<double> ? sign, int unitPrecision = 0, bool unitPrefix = false, String unitSeparator = ' '}) -
Prints numbers using a decimal suffix for units measure to indicate a
multiple or sub-multiple of the unit.
factory
Properties
- base → int
-
The numeric base to which the number should be printed.
final
-
characters
→ List<
String> -
The characters to be used to convert a number to a string.
final
- defaultToStringPrinter → ObjectPrinter
-
Override to configure the empty ObjectPrinter.
no setterinherited
- delimiter → String
-
The delimiter to separate the integer and fraction part of the number.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- infinity → String
-
The string that should be displayed if the number is infinite.
final
- nan → String
-
The string that should be displayed if the number is not a number.
final
- padding → int
-
The number of digits to be printed.
final
- precision → int
-
The number of digits to be printed in the fraction part.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separator → String
-
The separator character to be used to group digits.
final
- separatorOffset → int
-
The offset of characters to be separated in a group.
final
- separatorWidth → int
-
The number of characters to be separated in a group.
final
-
sign
→ Printer<
double> ? -
The string to be prepended if the number is positive or negative.
final
- toStringPrinter → ObjectPrinter
-
Override and call super to add values to the ObjectPrinter.
no setteroverride
- unitBase → int
-
The base of the unit to be printed.
final
- unitOffset → int
-
The exponent offset of the units to be printed.
final
- unitPrecision → int
-
The number of digits to be printed for unit numbers.
final
- unitPrefix → bool
-
Whether the unit should be used as a prefix, instead of an suffix.
final
-
units
→ List<
String> -
The units to be used.
final
- unitSeparator → String
-
Separator between value and unit.
final
Methods
-
call(
T object) → String -
Prints the
object
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
print(
T object) → String -
Returns the printed
object
.inherited -
printOn(
T object, StringBuffer buffer) → void -
Prints the
object
intobuffer
.override -
toString(
) → String -
Standard
toString
implementation. Do not override, instead implement toStringPrinter to customize.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited