Skip to content

Commit

Permalink
Fixing siFormat issue when 0. Fixes #170 (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines authored Dec 19, 2022
1 parent c820632 commit 526d06e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/jerboa/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ fun validateUrl(
}

fun siFormat(num: Int): String {
// Weird bug where if num is zero, it won't format
if (num == 0) return "0"
var value = num.toDouble()
val suffix = " KMBT"
val formatter = DecimalFormat("#,###.#")
Expand Down

0 comments on commit 526d06e

Please sign in to comment.