Add `µBTC` as a recognized `str` form of `uBTC`

`µ` is the correct letter for the SI unit micro but is not on most
standard keyboards.  `u` was used instead because it looks similar.

Add `µBTC` to the list of recognized strings for MicroBitcoin and to the
rustdocs.
This commit is contained in:
Jamil Lambert, PhD 2025-01-22 13:12:40 +00:00
parent 39dd3cad20
commit 2ca24f00f2
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
1 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ pub use self::{
/// ///
/// # Accepted Denominations /// # Accepted Denominations
/// ///
/// All upper or lower case, excluding SI prefix (c, m, u) which must be lower case. /// All upper or lower case, excluding SI prefixes c, m and u (or µ) which must be lower case.
/// - Singular: BTC, cBTC, mBTC, uBTC /// - Singular: BTC, cBTC, mBTC, uBTC
/// - Plural or singular: sat, satoshi, bit /// - Plural or singular: sat, satoshi, bit
/// ///
@ -119,7 +119,7 @@ impl Denomination {
"BTC" | "btc" => Some(Denomination::Bitcoin), "BTC" | "btc" => Some(Denomination::Bitcoin),
"cBTC" | "cbtc" => Some(Denomination::CentiBitcoin), "cBTC" | "cbtc" => Some(Denomination::CentiBitcoin),
"mBTC" | "mbtc" => Some(Denomination::MilliBitcoin), "mBTC" | "mbtc" => Some(Denomination::MilliBitcoin),
"uBTC" | "ubtc" => Some(Denomination::MicroBitcoin), "uBTC" | "ubtc" | "µBTC" | "µbtc" => Some(Denomination::MicroBitcoin),
"bit" | "bits" | "BIT" | "BITS" => Some(Denomination::Bit), "bit" | "bits" | "BIT" | "BITS" => Some(Denomination::Bit),
"SATOSHI" | "satoshi" | "SATOSHIS" | "satoshis" | "SAT" | "sat" | "SATS" | "sats" => "SATOSHI" | "satoshi" | "SATOSHIS" | "satoshis" | "SAT" | "sat" | "SATS" | "sats" =>
Some(Denomination::Satoshi), Some(Denomination::Satoshi),