Skip to content

Use a formatter to display Btc/MilliBtc amounts #90

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

Merged
merged 2 commits into from
Feb 12, 2025
Merged

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Feb 11, 2025

Display at most 8 decimals, instead of the default which may even use the exponent display occasionnally.

Please double check the MilliBtc case as it's easy to get it wrong.

Display a fixed number of digits after the comma, instead of the default which may even use the exponent display occasionnally.

Please double check the `MilliBtc` case as it's easy to get it wrong.
@pm47 pm47 requested a review from sstone February 11, 2025 16:34
Copy link
Member

@sstone sstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth adding a basic test in BtcAmountSpec (and it will illustrate what the new format looks like).

@pm47
Copy link
Member Author

pm47 commented Feb 11, 2025

Totally! Done in f275ea5.

Note that I hardcoded the locale to US. We don't have to do it, but then test success depends on JVM settings (both maven and intellij seem to ignore locale settings put in either the pom properties or surefire conf).

Also, I switched to at most 8 decimals instead of always 8 decimals (1.2345 instead of 1.23450000). I think it's more readable.

@pm47 pm47 merged commit 7e22f43 into master Feb 12, 2025
1 check passed
@pm47 pm47 deleted the format-btc-amounts branch February 12, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants