fix issue with big blind display

feature/top10
Razmig Sarkissian 7 years ago
parent 1c2aa267f8
commit f419fa9468
  1. 5
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -166,6 +166,7 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
var cgBigBlind: Double? = null
set(value) {
this.hasBigBlind = if (value != null) 1 else 0
field = value
}
// Tournament
@ -415,7 +416,7 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
fun getBlinds(): String {
val currencyCode = bankroll?.currency?.code ?: Currency.getInstance(Locale.getDefault()).currencyCode
val currencySymbol = Currency.getInstance(currencyCode).symbol
return if (cgSmallBlind == null) NULL_TEXT else "$currencySymbol ${cgSmallBlind?.formatted()}/${cgBigBlind?.formatted()}"
return if (cgSmallBlind == null) NULL_TEXT else "$currencySymbol ${cgSmallBlind?.formatted()}/${cgBigBlind?.round()}"
}
/**
@ -653,12 +654,12 @@ open class Session : RealmObject(), Manageable, StaticRowRepresentableDataSource
when (row) {
SessionRow.BANKROLL -> bankroll = value as Bankroll?
SessionRow.BLINDS -> if (value is ArrayList<*>) {
cgSmallBlind = try {
(value[0] as String? ?: "0").toDouble()
} catch (e: Exception) {
null
}
cgBigBlind = try {
(value[1] as String? ?: "0").toDouble()
} catch (e: Exception) {

Loading…
Cancel
Save