algorandfoundation / algokit-lora

https://lora.algokit.io
12 stars 5 forks source link

Make the transaction visualiser amount rounding/truncation a little smarter #238

Closed neilcampbell closed 2 months ago

neilcampbell commented 2 months ago

Values like 0.000115A are being rounding to ≈0.00012A, to ensure the amount fits within the small space we have. In this scenario we have the space, so it'd be good to add a little more logic to try prevent the rounding where possible.

neilcampbell commented 2 months ago

From discord https://discord.com/channels/491256308461207573/1277185471214256138

neilcampbell commented 2 months ago

@satishccy Some additional context for this one. To fix this it's probably changing this line https://github.com/algorandfoundation/algokit-lora/blob/main/src/utils/compact-amount.ts#L4 from 8 to 9. Whilst it's likely an easy fix, it'll require some visual verification/checks. You'll also need to re-run the tests, re-generate test snapshots and visually inspect the transactions in those snapshots to confirm everything looks ok.