currency.opBinary

Can divide by money amount of the same type https://en.wikipedia.org/wiki/Integer#Algebraic_properties

amount is integer, which is closed under "+|-|*", but not "/" so the return type is double to simulate rational

  1. T opBinary(T rhs)
  2. double opBinary(T rhs)
    struct currency(string currency_name, int dec_places = 4, roundingMode rmode = roundingMode.HALF_UP)
    const
    double
    opBinary
    (
    string op
    )
    (
    const T rhs
    )
    if (
    op == "/"
    )
  3. T opBinary(long rhs)
  4. T opBinary(real rhs)

Meta