From 87c52f7e58155367f44eb4bef333478ba41da1cf Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 14 Feb 2022 20:57:50 +0000 Subject: [PATCH] Format file. --- .../java/com/github/libretube/VideoViews.kt | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/github/libretube/VideoViews.kt b/app/src/main/java/com/github/libretube/VideoViews.kt index f8f45677c..41c7c4cbe 100644 --- a/app/src/main/java/com/github/libretube/VideoViews.kt +++ b/app/src/main/java/com/github/libretube/VideoViews.kt @@ -4,19 +4,19 @@ import java.math.BigDecimal import java.math.RoundingMode fun Long?.formatShort(): String = when { - this!!<1000 -> { - this.toString() - } - this in 1000..999999 -> { - val decimal = BigDecimal(this/1000).setScale(0, RoundingMode.HALF_EVEN) - decimal.toString()+"K" - } - this in 1000000..10000000 -> { - val decimal = BigDecimal(this/1000000).setScale(0, RoundingMode.HALF_EVEN) - decimal.toString()+"M" - } - else -> { - val decimal = BigDecimal(this/1000000).setScale(0, RoundingMode.HALF_EVEN) - decimal.toString()+"M" - } - } + this!! < 1000 -> { + this.toString() + } + this in 1000..999999 -> { + val decimal = BigDecimal(this / 1000).setScale(0, RoundingMode.HALF_EVEN) + decimal.toString() + "K" + } + this in 1000000..10000000 -> { + val decimal = BigDecimal(this / 1000000).setScale(0, RoundingMode.HALF_EVEN) + decimal.toString() + "M" + } + else -> { + val decimal = BigDecimal(this / 1000000).setScale(0, RoundingMode.HALF_EVEN) + decimal.toString() + "M" + } +}