Skip to content

Commit 6985f9c

Browse files
fix: Stellar amount and fee display format
1 parent b343e09 commit 6985f9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/stellar_app/stellar_txn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static bool get_user_verification(void) {
451451
char amount_string[30] = {'\0'};
452452
double decimal_amount = (double)decoded_txn->operations[0].amount;
453453
decimal_amount *= 1e-7; // Convert stroops to XLM
454-
snprintf(amount_string, sizeof(amount_string), "%.*g", 7, decimal_amount);
454+
snprintf(amount_string, sizeof(amount_string), "%.7f", decimal_amount);
455455

456456
char display[100] = {'\0'};
457457
snprintf(display,
@@ -468,7 +468,7 @@ static bool get_user_verification(void) {
468468
char fee_string[30] = {'\0'};
469469
double decimal_fee = (double)decoded_txn->fee;
470470
decimal_fee *= 1e-7; // Convert stroops to XLM
471-
snprintf(fee_string, sizeof(fee_string), "%.*g", 7, decimal_fee);
471+
snprintf(fee_string, sizeof(fee_string), "%.7f", decimal_fee);
472472

473473
char fee_display[50] = {'\0'};
474474
snprintf(fee_display,

0 commit comments

Comments
 (0)