numeric_utils 0.2.2
numeric_utils: ^0.2.2 copied to clipboard
Provides extensions and utility functions for working with numeric types in Dart, including Rational and BigInt.
0.2.2 - 2025-03-27 #
Upgraded #
RationalFormattingExtension.toPercentage: Now takes an optional parameterasRatioto determine whether to treat the input as a ratio value (e.g., 33/100 or 0.33) or a value between 0 and 100 (e.g., 33 out of 100). Defaults totruefor backward compatibility.
0.2.1 - 2025-03-26 #
Added #
RationalParsing.tryFromString: A version ofRationalParsing.fromStringthat returns null if parsing fails.
0.2.0 - 2025-03-05 #
Added #
RationalParsing.fromString: A new utility method that parses strings intoRationalobjects, supporting the output ofRational.toString(e.g., fractions like "3/4", mixed numbers like "1 3/4") as well as formats parsable byRational.parse(e.g., integers, decimals, scientific notation). Enables round-trip serialization for JSON and other formats.
0.1.0 - 2025-02-23 #
- Initial version of numeric_utils.
- Features:
- Added
RationalRoundingExtensionwith various rounding methods (rounded,toNearest, etc.).- Added
RoundingModeenum.
- Added
- Added
BigIntRoundedDivisionExtensionfor rounded division of BigInts. - Added
RationalFormattingExtensionwithtoDecimalPlaces,toCurrencyandtoPercentagemethods. - Added
RationalCommonRoundingExtensionwithtoDecimalPlace,toCents,toNearestHalf,toNearestThird, andtoNearestQuartermethods. - Added
BigIntMultipleOfExtensionandIntMultipleOfExtensionforisMultipleOfmethods.
- Added
- Constants:
- Added
RationalConstantswith common rational values as well asIntConstantsandBigIntConstants
- Added