2024-03-06 22:34:15 +00:00
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'package:tetra_stats/gen/strings.g.dart';
|
|
|
|
|
2024-09-08 22:10:51 +00:00
|
|
|
final NumberFormat compareIntf = NumberFormat("+#,###;-#,###")..maximumFractionDigits = 0;
|
2024-11-05 23:07:43 +00:00
|
|
|
final NumberFormat fDiff = NumberFormat("+#,###.####;-#,###.####");
|
2024-03-06 22:34:15 +00:00
|
|
|
final NumberFormat comparef = NumberFormat("+#,###.###;-#,###.###")..maximumFractionDigits = 3;
|
2024-05-02 22:26:12 +00:00
|
|
|
final NumberFormat comparef2 = NumberFormat("+#,###.##;-#,###.##")..maximumFractionDigits = 2;
|
2024-03-06 22:34:15 +00:00
|
|
|
final NumberFormat intf = NumberFormat.decimalPatternDigits(locale: LocaleSettings.currentLocale.languageCode, decimalDigits: 0);
|
2024-03-14 22:53:19 +00:00
|
|
|
final NumberFormat f4 = NumberFormat.decimalPatternDigits(locale: LocaleSettings.currentLocale.languageCode, decimalDigits: 4);
|
2024-03-18 22:39:41 +00:00
|
|
|
final NumberFormat f3 = NumberFormat.decimalPatternDigits(locale: LocaleSettings.currentLocale.languageCode, decimalDigits: 3);
|
|
|
|
final NumberFormat f2 = NumberFormat.decimalPatternDigits(locale: LocaleSettings.currentLocale.languageCode, decimalDigits: 2);
|
2024-03-20 22:56:13 +00:00
|
|
|
final NumberFormat f2l = NumberFormat.decimalPatternDigits(locale: LocaleSettings.currentLocale.languageCode, decimalDigits: 2)..minimumFractionDigits = 0;
|
2024-06-11 16:30:13 +00:00
|
|
|
final NumberFormat f1 = NumberFormat.decimalPatternDigits(locale: LocaleSettings.currentLocale.languageCode, decimalDigits: 1);
|
2024-03-24 16:38:06 +00:00
|
|
|
final NumberFormat f0 = NumberFormat.decimalPattern(LocaleSettings.currentLocale.languageCode);
|
2024-06-14 20:47:36 +00:00
|
|
|
final NumberFormat percentage = NumberFormat.percentPattern(LocaleSettings.currentLocale.languageCode)..maximumFractionDigits = 2;
|
|
|
|
|
|
|
|
/// Readable [a] - [b], without sign
|
|
|
|
String readableIntDifference(int a, int b){
|
|
|
|
int result = a - b;
|
|
|
|
|
|
|
|
return NumberFormat("#,###;#,###", LocaleSettings.currentLocale.languageCode).format(result);
|
|
|
|
}
|