pub struct DecimalTool;Implementations§
Source§impl DecimalTool
impl DecimalTool
pub fn new() -> Self
pub fn of(&self, s: &str) -> Result<Decimal>
pub fn zero(&self) -> Decimal
pub fn one(&self) -> Decimal
pub fn add(&self, a: Decimal, b: Decimal) -> Decimal
pub fn sub(&self, a: Decimal, b: Decimal) -> Decimal
pub fn mul(&self, a: Decimal, b: Decimal) -> Decimal
pub fn div(&self, a: Decimal, b: Decimal) -> Result<Decimal>
pub fn round(&self, a: Decimal, dp: u32) -> Decimal
pub fn ceil(&self, a: Decimal) -> Decimal
pub fn floor(&self, a: Decimal) -> Decimal
pub fn abs(&self, a: Decimal) -> Decimal
pub fn min(&self, a: Decimal, b: Decimal) -> Decimal
pub fn max(&self, a: Decimal, b: Decimal) -> Decimal
pub fn percent(&self, amount: Decimal, pct: Decimal) -> Decimal
pub fn ratio(&self, part: Decimal, total: Decimal) -> Result<Decimal>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DecimalTool
impl RefUnwindSafe for DecimalTool
impl Send for DecimalTool
impl Sync for DecimalTool
impl Unpin for DecimalTool
impl UnsafeUnpin for DecimalTool
impl UnwindSafe for DecimalTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more