|
|
|
@ -9,7 +9,6 @@ import net.pokeranalytics.android.util.Preferences |
|
|
|
import net.pokeranalytics.android.util.formatted |
|
|
|
import net.pokeranalytics.android.util.formatted |
|
|
|
import net.pokeranalytics.android.util.toMinutes |
|
|
|
import net.pokeranalytics.android.util.toMinutes |
|
|
|
import java.text.NumberFormat |
|
|
|
import java.text.NumberFormat |
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* An enum representing all the types of Session statistics |
|
|
|
* An enum representing all the types of Session statistics |
|
|
|
@ -126,6 +125,8 @@ class ComputedStat(stat: Stat, value: Double) { |
|
|
|
Stat.NETRESULT, Stat.HOURLY_RATE, Stat.AVERAGE, Stat.NET_BB_PER_100_HANDS, Stat.HOURLY_RATE_BB, |
|
|
|
Stat.NETRESULT, Stat.HOURLY_RATE, Stat.AVERAGE, Stat.NET_BB_PER_100_HANDS, Stat.HOURLY_RATE_BB, |
|
|
|
Stat.AVERAGE_NET_BB -> { |
|
|
|
Stat.AVERAGE_NET_BB -> { |
|
|
|
val numberFormat = NumberFormat.getCurrencyInstance(Preferences.getCurrencyLocale(context)) |
|
|
|
val numberFormat = NumberFormat.getCurrencyInstance(Preferences.getCurrencyLocale(context)) |
|
|
|
|
|
|
|
numberFormat.minimumFractionDigits = 0 |
|
|
|
|
|
|
|
numberFormat.maximumFractionDigits = 2 |
|
|
|
val color = if (this.value >= this.stat.threshold) R.color.green else R.color.red |
|
|
|
val color = if (this.value >= this.stat.threshold) R.color.green else R.color.red |
|
|
|
return TextFormat(numberFormat.format(this.value), color) |
|
|
|
return TextFormat(numberFormat.format(this.value), color) |
|
|
|
} // white integers |
|
|
|
} // white integers |
|
|
|
@ -142,6 +143,8 @@ class ComputedStat(stat: Stat, value: Double) { |
|
|
|
Stat.AVERAGE_BUYIN, Stat.STANDARD_DEVIATION, Stat.STANDARD_DEVIATION_HOURLY, |
|
|
|
Stat.AVERAGE_BUYIN, Stat.STANDARD_DEVIATION, Stat.STANDARD_DEVIATION_HOURLY, |
|
|
|
Stat.STANDARD_DEVIATION_BB_PER_100_HANDS -> { |
|
|
|
Stat.STANDARD_DEVIATION_BB_PER_100_HANDS -> { |
|
|
|
val numberFormat = NumberFormat.getCurrencyInstance(Preferences.getCurrencyLocale(context)) |
|
|
|
val numberFormat = NumberFormat.getCurrencyInstance(Preferences.getCurrencyLocale(context)) |
|
|
|
|
|
|
|
numberFormat.minimumFractionDigits = 0 |
|
|
|
|
|
|
|
numberFormat.maximumFractionDigits = 2 |
|
|
|
return TextFormat(numberFormat.format(this.value)) |
|
|
|
return TextFormat(numberFormat.format(this.value)) |
|
|
|
} |
|
|
|
} |
|
|
|
else -> throw FormattingException("Stat formatting of ${this.stat.name} not handled") |
|
|
|
else -> throw FormattingException("Stat formatting of ${this.stat.name} not handled") |
|
|
|
|