format_bytes library
Format raw byte amounts as pretty strings.
Classes
- Unit
- Describes a storage amount unit
Enums
- UnitType
- Binary ot Decimal based unit
Constants
- defaultFormatString → const String
- defaultSeparator → const String
Functions
-
createPrecisionFormatter(
int minDecimals, int maxDecimals, int maxPrecision, String locale) → AmountToString - Creates a AmountToString transformer with specified precision.
-
format(
num amount, {String locale = 'en', String formatString = defaultFormatString, String separator = defaultSeparator, AmountToString? customAmountTransformer, int minDecimals = 0, int maxDecimals = 2, int maxPrecision = -1, Unit unit = Unit.auto, UnitType unitType = UnitType.binary}) → String - Formats a byte amount as human readable string.
Typedefs
- AmountToString = String Function(double amount)
- A function that transforms double to String.