chore: rename func

This commit is contained in:
2024-09-15 11:54:00 +08:00
parent 983a907a53
commit 282aaebbd2
2 files changed
+13 -12

No files matched your search

@@ -31,3 +31,12 @@ fun Int.formatNumber(): String {
this.toString()
}
}
fun Int.formatNumberEnglish(): String {
return when {
this >= 1_000_000 -> String.format("%.1fM", this / 1_000_000.0)
this >= 10_000 -> String.format("%.1fk", this / 1_000.0)
this >= 1_000 -> String.format("%dk", this / 1_000)
else -> this.toString()
}
}