Skip to content

Commit cb0648e

Browse files
committed
make rounding code more readable
1 parent dc18f27 commit cb0648e

File tree

1 file changed

+3
-3
lines changed
  • billinghelper/src/main/kotlin/com/vojtkovszky/billinghelper

1 file changed

+3
-3
lines changed

billinghelper/src/main/kotlin/com/vojtkovszky/billinghelper/PriceUtil.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ object PriceUtil {
5757
}
5858

5959
private fun roundDigitString(digitValue: Double): String {
60-
var priceValueString = "?"
61-
if (digitValue > 1000.0) priceValueString = digitValue.roundToLong().toString()
62-
else if (digitValue <= 1000.0) priceValueString = String.format("%.2f", digitValue)
60+
val priceValueString =
61+
if (digitValue > 1000.0) digitValue.roundToLong().toString() else
62+
String.format("%.2f", digitValue)
6363
return priceValueString.replace(".", ",")
6464
}
6565
}

0 commit comments

Comments
 (0)