d887423efc
It is common to display bitcoins using trailing zeros upto 8 decimals. This commit enforces: - Displaying Amount in BTC with trailing zeroes by eight decimal places if a precision on the Amount is not specified. - Displaying Amount in BTC upto the precision specified truncating the insignificant zeros. - Displaying amount in BTC without any decimals if the remainder of the amount divided by the satoshis in 1 BTC is equal to zero using formula `satoshis.rem_euclid(Amount::ONE_BTC.to_sat()) != 0` These are not breaking changes and all previous tests pass. A testcase is added to for changes introduced. Resolves: #2136 |
||
---|---|---|
.. | ||
contrib | ||
src | ||
Cargo.toml | ||
README.md |
README.md
Bitcoin Units
This crate provides basic Bitcoin numeric units such as Amount
.
Minimum Supported Rust Version (MSRV)
This library should always compile with any combination of features on Rust 1.56.1.
Licensing
The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.