Patch level : 12.0 no-patch

Files correlati     :

Aggiunto operatore
  TCurrency& operator /= (const real& num);
This commit is contained in:
Alessandro Bonazzi 2020-04-26 14:41:41 +02:00
parent f5fe0b26d0
commit 0861409fb7

View File

@ -427,6 +427,7 @@ TCurrency& TCurrency::operator+=(const TCurrency& cur)
TCurrency TCurrency::operator+(const TCurrency& num) const
{
TCurrency cur(*this);
cur += num;
return cur;
}
@ -447,6 +448,7 @@ TCurrency& TCurrency::operator-=(const TCurrency& cur)
TCurrency TCurrency::operator-(const TCurrency& num) const
{
TCurrency cur(*this);
cur -= num;
return cur;
}
@ -461,10 +463,26 @@ TCurrency& TCurrency::operator*=(const real& num)
TCurrency TCurrency::operator*(const real& num) const
{
TCurrency cur(*this);
cur *= num;
return cur;
}
TCurrency& TCurrency::operator /= (const real& num)
{
_num /= num;
_num.round(decimals());
return *this;
}
TCurrency TCurrency::operator / (const real& num) const
{
TCurrency cur(*this);
cur /= num;
return cur;
}
TCurrency TCurrency::abs() const
{
if (_num.sign() < 0)