You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Guestbook frontend: use the SDK's token amount helper instead of dividing by 1e7 #2965
What's wrong:
The page tells readers the balance "comes back in stroops, so there's a / 1e7 in the markup". Floating-point division can show rounding errors, and the pattern gets copied into payment code where it matters.
Change needed:
Point readers at the SDK's amount helper for display, and mention its counterpart for parsing user input.
@kaankacar@ElliotFriend, one decision is needed: should the guestbook page recommend the SDK amount helpers while its companion app still divides by 1e7?
Facts I checked:
The page only describes the markup. The division is in the app: Settings.svelte:122 has parseFloat((Number(balance) / 1e7).toFixed(2)).
Soroban.formatTokenAmount and Soroban.parseTokenAmount are exported from @stellar/stellar-sdk in 16.4.1 and 17.4.0. The app pins ^16.3.0.
formatTokenAmount(balance, 7) shows all 7 decimals. The app now rounds to 2, so the shown balance changes.
The donate flow takes whole tokens through the kit, so the app does not parse user input.
Options:
Change the app first, then I update the page to match.
Docs only: say the markup converts stroops to XLM, and add a <Tip> that names both helpers for amount math. Page and app stay in sync.
Leave the page as it is.
I can open the PR for option 1 or 2 when you pick.
Activity
stellar-doxie commentedon Nov 1, 2026
🤖 Automated message from the Stellar Triage Bot.
I saw this issue. I have not worked on it, because nobody has called me in yet.
How to reach me:
/triage, add thebot:takelabel, or assign @kaankacar, @ElliotFriend or @wmendes./triage stop. People with write permission can also add thebot:hands-offlabel.oceans404 commentedon Nov 1, 2026
/triage
stellar-doxie commentedon Nov 1, 2026
🤖 Automated message from the Stellar Triage Bot.
Working this because @oceans404 added bot:take.
I am checking the page and the SDK helpers now. I will post the result here.
stellar-doxie commentedon Nov 1, 2026
🤖 Automated message from the Stellar Triage Bot.
Working this because @oceans404 added bot:take.
@kaankacar @ElliotFriend, one decision is needed: should the guestbook page recommend the SDK amount helpers while its companion app still divides by
1e7?Facts I checked:
Settings.svelte:122hasparseFloat((Number(balance) / 1e7).toFixed(2)).Soroban.formatTokenAmountandSoroban.parseTokenAmountare exported from@stellar/stellar-sdkin 16.4.1 and 17.4.0. The app pins^16.3.0.formatTokenAmount(balance, 7)shows all 7 decimals. The app now rounds to 2, so the shown balance changes.Options:
<Tip>that names both helpers for amount math. Page and app stay in sync.I can open the PR for option 1 or 2 when you pick.
fix(settings): format balance with the SDK amount helper
docs: truncate the guestbook balance without Intl rounding modes
docs: shorten the guestbook amount helper tip and link the SDK reference
Sync guestbook tutorial snippets with the companion app (stellar#3084)