Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Amount Debug impl to BTC with 8 decimals #414

wants to merge 1 commit into
base: master


Copy link

stevenroose commented Mar 7, 2020

I've been working a bit with Amounts and the satoshi notation is really confusing if you're dealing with 1 BTC+ amounts. The Debug trait is meant to as easily as possible give the developer an idea of the amount, so adding a decimal point gives strictly more information. Like this it always shows 8 digits.

This should not be considered a breaking change, IMO. The Debug trait is not intended to be parseable.


This comment has been minimized.

Copy link

elichai commented Mar 8, 2020

Why not use the Display trait if you want BTC amounts?
I personally prefer have the Debug method as close as possible to the actual type in the struct, because this is what you usually need when debugging(which is why I almost always derive it).

Right now: display: 432.43243256 BTC, debug: Amount(43243243256 satoshi)
After the change: display: 432.43243256 BTC, debug: Amount(432.43243256 BTC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.