Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.mifospay.core.designsystem.component.MifosTextUserImage
import org.mifospay.core.model.account.RecentPayee
import template.core.base.designsystem.KptMaterialTheme
import template.core.base.designsystem.theme.KptTheme
import kotlin.math.roundToInt

@Composable
fun RecentPayeeCard(
Expand Down Expand Up @@ -125,8 +126,9 @@ private fun formatAccountDisplay(accountNo: String): String {
* Formats amount with currency symbol
*/
private fun formatAmount(currency: String, amount: Double): String {
val wholePart = amount.toLong()
val decimalPart = ((amount - wholePart) * 100).toInt()
val cents = (amount * 100).roundToInt()
val wholePart = cents / 100
val decimalPart = cents % 100
val formattedWhole = wholePart.toString()
.reversed()
.chunked(3)
Expand Down