Page MenuHomePhabricator

[cashtab] Always show 2 decimals for amounts < 1k XEC
ClosedPublic

Authored by Fabien on Thu, Jan 2, 10:35.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC37545e85844f: [cashtab] Always show 2 decimals for amounts < 1k XEC
Summary

A tx that sends 42 XEC will show 42 XEC, then 42.00 XEC if clicked (because it now shows the detailed amount). While this feature is useful for amounts > 1000 because there is a change in units (k, M, B, etc.) this is confusing for plain XEC. This is looking even worse if the amount is a single decimal like 42.1 XEC.

Always use 2 decimals for amounts below 1k XEC.

Depends on D17450

Test Plan
npm run test
npm run start

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cashtab_unit_2_decimals
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31882
Build 63256: Build Diffcashtab-tests
Build 63255: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Thu, Jan 2, 10:35
bytesofman requested changes to this revision.Thu, Jan 2, 13:22
bytesofman added a subscriber: bytesofman.

I think the change is good but should implement by adding a new mock tx and test instead of changing the values of an existing mock.

my usual workflow for this -- I have a local repo that lets me run chronik calls from CI. I use this to get mocks and copy paste them into the mocks file matching existing shapes.

This revision now requires changes to proceed.Thu, Jan 2, 13:22

Don't change the mock, but reuse the existing ones to add a test case.
Bump the version

This revision is now accepted and ready to land.Thu, Jan 2, 15:08