Created
August 15, 2022 15:06
-
-
Save fanjavaid/520f808b16fb034a4dad938226573e3a to your computer and use it in GitHub Desktop.
Simple thousand formatter and cleaner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Long.formatThousand(): String { | |
val decimalFormatter = DecimalFormat("#,###") | |
return decimalFormatter.format(this) | |
} | |
fun String.clearThousandFormat(): String { | |
return this.replace(",", "") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment