File tree Expand file tree Collapse file tree
apps/flipcash/features/tokens/src/main/kotlin/com/flipcash/app/tokens/internal
services/opencode/src/main/kotlin/com/getcode/opencode/model/financial Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,7 +156,9 @@ private fun SellReceipt(
156156 ReceiptLineItem (
157157 modifier = Modifier .fillMaxWidth(),
158158 label = " ${fee.roundToInt()} % Fee" ,
159- amount = feeAmount.formatted(),
159+ amount = feeAmount.formatted(
160+ extraPrefix = if (feeAmount.decimalValue != 1.0 ) " ~" else null ,
161+ ),
160162 )
161163 }
162164 }
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ data class Fiat(
7373 fun formatted (
7474 rule : FormattingRule = FormattingRule .None ,
7575 showPrefix : Boolean = true,
76+ extraPrefix : String? = null,
7677 includeCommas : Boolean = true,
7778 ): String {
7879 val shouldTruncate = if (rule is FormattingRule .Truncated ) {
@@ -103,8 +104,14 @@ data class Fiat(
103104 .takeIf { showPrefix }
104105 .orEmpty()
105106
106- positivePrefix = prefix
107- negativePrefix = prefix
107+ val fullPrefix = if (extraPrefix != null ) {
108+ " $extraPrefix $prefix "
109+ } else {
110+ prefix
111+ }
112+
113+ positivePrefix = fullPrefix
114+ negativePrefix = fullPrefix
108115 isGroupingUsed = includeCommas
109116 }
110117
You can’t perform that action at this time.
0 commit comments