Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-23 18:40:36 +03:00
parent 2b09748877
commit 8a3843d87c
12 changed files with 79 additions and 50 deletions

View file

@ -100,12 +100,12 @@ internal class MetricsConverter(
},
),
InfoPointUM(
title = resourceReference(R.string.markets_token_details_total_supply),
value = totalSupply.formatAmount(crypto = true),
title = resourceReference(R.string.markets_token_details_max_supply),
value = maxSupply.formatMaxSupply(),
onInfoClick = {
onInfoClick(
InfoBottomSheetContent(
title = resourceReference(R.string.markets_token_details_total_supply_full),
title = resourceReference(R.string.markets_token_details_max_supply_full),
body = resourceReference(R.string.markets_token_details_total_supply_description),
),
)
@ -116,6 +116,15 @@ internal class MetricsConverter(
}
}
private fun BigDecimal?.formatMaxSupply(): String {
when (this) {
null -> return StringsSigns.DASH_SIGN
BigDecimal.ZERO -> return StringsSigns.INFINITY_SIGN
}
return this.formatAmount(crypto = true)
}
private fun BigDecimal?.formatAmount(crypto: Boolean = false): String {
if (this == null) return StringsSigns.DASH_SIGN