rtlibs-utils 0.1.6

rtools library: utilities
Documentation
use super::Currency;
use super::CurrencyImpl;

#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Euro(pub i32);

impl std::fmt::Display for Euro
{
    fn fmt(
        &self,
        f: &mut std::fmt::Formatter<'_>,
    ) -> std::fmt::Result
    {
        Currency(
            self.0,
            self.currency(),
        )
        .fmt(f)
    }
}

impl CurrencyImpl for Euro
{
    fn value(&self) -> i32
    {
        self.0
    }

    fn currency(&self) -> &str
    {
        ""
    }

    fn pad(
        &self,
        pad: usize,
    ) -> String
    {
        Currency(
            self.0,
            self.currency(),
        )
        .pad(pad)
    }

    fn idn(
        &self
    ) -> (
        u32,
        u32,
        bool,
    )
    {
        Currency(
            self.0,
            self.currency(),
        )
        .idn()
    }
}