Refactor duplicate chapter number formatters

This commit is contained in:
arkon
2023-07-23 18:09:08 -04:00
parent 7aa172c512
commit 2556e9f08c
6 changed files with 28 additions and 36 deletions

View File

@@ -0,0 +1,13 @@
package eu.kanade.presentation.util
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
private val formatter = DecimalFormat(
"#.###",
DecimalFormatSymbols().apply { decimalSeparator = '.' },
)
fun formatChapterNumber(chapterNumber: Float): String {
return formatter.format(chapterNumber)
}