File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
app/src/main/java/to/bitkit/models Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,16 @@ fun Long.formatToModernDisplay(locale: Locale = Locale.getDefault()): String {
106106fun ULong.formatToModernDisplay (locale : Locale = Locale .getDefault()): String = toLong().formatToModernDisplay(locale)
107107
108108fun Long.formatToClassicDisplay (locale : Locale = Locale .getDefault()): String {
109- val sats = this
110109 val symbols = DecimalFormatSymbols (locale).apply {
111110 decimalSeparator = DECIMAL_SEPARATOR
112111 }
113- val formatter = DecimalFormat (" ###.########" , symbols)
114- return formatter.format(sats.asBtc())
112+ val pattern = " 0.${" 0" .repeat(CLASSIC_DECIMALS )} "
113+ val formatter = DecimalFormat (pattern, symbols).apply {
114+ minimumFractionDigits = CLASSIC_DECIMALS
115+ maximumFractionDigits = CLASSIC_DECIMALS
116+ isGroupingUsed = false
117+ }
118+ return formatter.format(asBtc())
115119}
116120
117121fun BigDecimal.formatCurrency (decimalPlaces : Int = FIAT_DECIMALS , locale : Locale = Locale .getDefault()): String? {
You can’t perform that action at this time.
0 commit comments