public static UMoney Round( UMoney value, int scale, MidpointRounding mode) { return(new UMoney(Money.Round(value._value, scale, mode))); }
/// <summary> /// Round specified value to the specified scale and express it as a significand. /// </summary> public static UMoney Denominate( UMoney value, int scale) { return(new UMoney ( significand: Money.Round(value._value, scale).Significand, scale: 0 )); }
public static UMoney Subtract( UMoney left, UMoney right) { if (right > left) { throw new OverflowException("The result should be grater or equal to zero."); } return(new UMoney(left._value - right._value)); }
public static bool TryParse( string value, out UMoney result) { if (value != null && UMoneyFormat.IsMatch(value)) { result = Create(Money.Parse(value)); return(true); } else { result = default; return(false); } }
public static UMoney Floor( UMoney value) { return(new UMoney(Money.Floor(value._value))); }
public static UMoney Divide( UMoney left, UMoney right) { return(new UMoney(left._value / right._value)); }
public static UMoney Ceiling( UMoney value) { return(new UMoney(Money.Ceiling(value._value))); }
public static UMoney Truncate( UMoney value) { return(new UMoney(Money.Truncate(value._value))); }
public static UMoney Add( UMoney left, UMoney right) { return(Create(left._value + right._value)); }
public static UMoney Round( UMoney value, int scale) { return(new UMoney(Money.Round(value._value, scale))); }
public static UMoney Multiply( UMoney left, UMoney right) { return(new UMoney(left._value * right._value)); }