Skip to content

Commit

Permalink
feat(number-system-utils): generic class in overall app
Browse files Browse the repository at this point in the history
Signed-off-by: kapdroid <[email protected]>
  • Loading branch information
kapdroid committed Sep 27, 2024
1 parent b7034e2 commit 936371b
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/src/utils/number_system_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@ class NumberSystemUtils {
decimalPlaces: decimalPlacesForInternational)
: _parseAsIndian(val ?? 0, decimalPlaces: decimalPlaces);

String _parseAsInternational(num val, {int decimalPlaces = 0}) {
return formatValue(
val.toDouble(),
locale: 'en_US',
decimalPlaces: decimalPlaces,
);
String _parseAsInternational(num val,
{int decimalPlaces = 0, bool isCompact = true}) {
return formatValue(val.toDouble(),
locale: 'en_US', decimalPlaces: decimalPlaces, isCompact: isCompact);
}

String _parseAsIndian(num val, {int decimalPlaces = 0}) {
return formatValue(
val.toDouble(),
locale: 'en_IN',
decimalPlaces: decimalPlaces,
);
String _parseAsIndian(num val,
{int decimalPlaces = 0, bool isCompact = true}) {
return formatValue(val.toDouble(),
locale: 'en_IN', decimalPlaces: decimalPlaces, isCompact: isCompact);
}
}

0 comments on commit 936371b

Please sign in to comment.