/// 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<SignedAmount, ParseAmountError> {
        let (negative, satoshi) = parse_signed_to_satoshi(s, denom)?;
        if satoshi > i64::max_value() as u64 {
            return Err(ParseAmountError::TooBig);
        }
        Ok(match negative {
            true => SignedAmount(-1 * satoshi as i64),
            false => SignedAmount(satoshi as i64),
        })
    }
pub fn from_str_in ( s : & str , denom : Denomination ) -> Result < SignedAmount , ParseAmountError > { let ( negative , satoshi ) = parse_signed_to_satoshi ( s , denom ) ? ; if satoshi > i64 :: max_value ( ) as u64 { return Err ( ParseAmountError :: TooBig ) ; } Ok ( match negative { true => SignedAmount ( - 1 * satoshi as i64 ) , false => SignedAmount ( satoshi as i64 ) , } ) }
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