From 2ca24f00f2161d6d618df2ee55d29c44ccce9359 Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Wed, 22 Jan 2025 13:12:40 +0000 Subject: [PATCH] =?UTF-8?q?Add=20`=C2=B5BTC`=20as=20a=20recognized=20`str`?= =?UTF-8?q?=20form=20of=20`uBTC`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `µ` 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. --- units/src/amount/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/units/src/amount/mod.rs b/units/src/amount/mod.rs index 8e3a92515..732f1cc10 100644 --- a/units/src/amount/mod.rs +++ b/units/src/amount/mod.rs @@ -42,7 +42,7 @@ pub use self::{ /// /// # 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 /// - Plural or singular: sat, satoshi, bit /// @@ -119,7 +119,7 @@ impl Denomination { "BTC" | "btc" => Some(Denomination::Bitcoin), "cBTC" | "cbtc" => Some(Denomination::CentiBitcoin), "mBTC" | "mbtc" => Some(Denomination::MilliBitcoin), - "uBTC" | "ubtc" => Some(Denomination::MicroBitcoin), + "uBTC" | "ubtc" | "µBTC" | "µbtc" => Some(Denomination::MicroBitcoin), "bit" | "bits" | "BIT" | "BITS" => Some(Denomination::Bit), "SATOSHI" | "satoshi" | "SATOSHIS" | "satoshis" | "SAT" | "sat" | "SATS" | "sats" => Some(Denomination::Satoshi),