/// Parse a decimal string as a value in the given denomination.
///
/// Note: This only parses the value string.  If you want to parse a value
/// with denomination, use [FromStr].
Parse a decimal string as a value in the given denomination.
Note: This only parses the value string.  If you want to parse a value
with denomination, use [FromStr].
Parse a decimal string as a value in the given denomination . Note : This only parses the value string . If you want to parse a value with denomination use [ FromStr ] .
pub fn from_str_in(s: &str, denom: Denomination) -> Result<Amount, ParseAmountError> {
        let (negative, satoshi) = parse_signed_to_satoshi(s, denom)?;
        if negative {
            return Err(ParseAmountError::Negative);
        }
        if satoshi > i64::max_value() as u64 {
            return Err(ParseAmountError::TooBig);
        }
        Ok(Amount::from_sat(satoshi))
    }
pub fn from_str_in ( s : & str , denom : Denomination ) -> Result < Amount , ParseAmountError > { let ( negative , satoshi ) = parse_signed_to_satoshi ( s , denom ) ? ; if negative { return Err ( ParseAmountError :: Negative ) ; } if satoshi > i64 :: max_value ( ) as u64 { return Err ( ParseAmountError :: TooBig ) ; } Ok ( Amount :: from_sat ( satoshi ) ) }
Parse a decimal string as a value in the given denomination.
Parse a decimal string as a value in the given denomination .
s
&str
denom
Denomination