Skip to content

Amount does not use minimal representation when displaying #709

@Kixunil

Description

@Kixunil
pritnln!("{}", Amount::from_sat(50_00_000_000).to_string_in(Denomination::Bitcoin));

Expected string: 50
Got: 50.00000000

This needlessly burdens users with meaningless zeros and causes BIP21 URIs to be longer, wasting QR space.

Ideally we would have struct DisplayInDenomination(Amount, Denomination) that impls Display with all the bells and whistles but for starters making representation minimal is fine.

I think this is easy enough for good first issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.0Issues and PRs required or helping to stabilize the APIbuggood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions