pub fn into(self, currency: Currency) -> BigDecimal {
        match currency {
            Currency::BIF
            | Currency::CLF
            | Currency::DJF
            | Currency::GNF
            | Currency::ISK
            | Currency::JPY
            | Currency::KMF
            | Currency::KRW
            | Currency::PYG
            | Currency::RWF
            | Currency::UGX
            | Currency::VND
            | Currency::VUV
            | Currency::XAF
            | Currency::XOF
            | Currency::XPF => {
                // For the following currencies, the value is the same as the
                // full charge amount. For example, amount = 100 is equal to
                // 100 Japanese Yen.
                BigDecimal::from(self.0)
            }
            Currency::BHD
            | Currency::IQD
            | Currency::JOD
            | Currency::KWD
            | Currency::LYD
            | Currency::OMR
            | Currency::TND => {
                // With the following currencies, divide the value by 1000 to
                // work out the value amount. For example, value = 1000 is the
                // same as 1 Bahraini Dinar.
                BigDecimal::from(self.0) / BigDecimal::from(1000)
            }
            _ => {
                // For all other currencies, divide the value by 100 to
                // calculate the charge amount. For example, value = 100 is
                // equivalent to 1 US Dollar.
                BigDecimal::from(self.0) / BigDecimal::from(100)
            }
        }
    }
/// Creates the amount from the raw value and currency. The currency is
/// required since the value is encoded as a scaled integer, which is
/// different depending on the currency.
Creates the amount from the raw value and currency. The currency is
required since the value is encoded as a scaled integer, which is
different depending on the currency.
Creates the amount from the raw value and currency . The currency is required since the value is encoded as a scaled integer which is different depending on the currency .
pub fn into(self, currency: Currency) -> BigDecimal {
        match currency {
            Currency::BIF
            | Currency::CLF
            | Currency::DJF
            | Currency::GNF
            | Currency::ISK
            | Currency::JPY
            | Currency::KMF
            | Currency::KRW
            | Currency::PYG
            | Currency::RWF
            | Currency::UGX
            | Currency::VND
            | Currency::VUV
            | Currency::XAF
            | Currency::XOF
            | Currency::XPF => {
                // For the following currencies, the value is the same as the
                // full charge amount. For example, amount = 100 is equal to
                // 100 Japanese Yen.
                BigDecimal::from(self.0)
            }
            Currency::BHD
            | Currency::IQD
            | Currency::JOD
            | Currency::KWD
            | Currency::LYD
            | Currency::OMR
            | Currency::TND => {
                // With the following currencies, divide the value by 1000 to
                // work out the value amount. For example, value = 1000 is the
                // same as 1 Bahraini Dinar.
                BigDecimal::from(self.0) / BigDecimal::from(1000)
            }
            _ => {
                // For all other currencies, divide the value by 100 to
                // calculate the charge amount. For example, value = 100 is
                // equivalent to 1 US Dollar.
                BigDecimal::from(self.0) / BigDecimal::from(100)
            }
        }
    }
pub fn into ( self , currency : Currency ) -> BigDecimal { match currency { Currency :: BIF | Currency :: CLF | Currency :: DJF | Currency :: GNF | Currency :: ISK | Currency :: JPY | Currency :: KMF | Currency :: KRW | Currency :: PYG | Currency :: RWF | Currency :: UGX | Currency :: VND | Currency :: VUV | Currency :: XAF | Currency :: XOF | Currency :: XPF => { // For the following currencies, the value is the same as the // full charge amount. For example, amount = 100 is equal to // 100 Japanese Yen. BigDecimal :: from ( self . 0 ) } Currency :: BHD | Currency :: IQD | Currency :: JOD | Currency :: KWD | Currency :: LYD | Currency :: OMR | Currency :: TND => { // With the following currencies, divide the value by 1000 to // work out the value amount. For example, value = 1000 is the // same as 1 Bahraini Dinar. BigDecimal :: from ( self . 0 ) / BigDecimal :: from ( 1000 ) } _ => { // For all other currencies, divide the value by 100 to // calculate the charge amount. For example, value = 100 is // equivalent to 1 US Dollar. BigDecimal :: from ( self . 0 ) / BigDecimal :: from ( 100 ) } } }
Creates the amount from the raw value and currency.
Creates the amount from the raw value and currency .
self
currency
Currency
self
currency
Currency