607 bool convertTo(
QString* aValue,
bool* aOk = 0)
const;
608 bool convertTo(
double* aValue,
bool* aOk = 0)
const;
609 bool convertTo(qint32* aValue,
bool* aOk = 0)
const;
610 bool convertTo(quint32* aValue,
bool* aOk = 0)
const;
611 bool convertTo(qlonglong* aValue,
bool* aOk = 0)
const;
612 bool convertTo(qulonglong* aValue,
bool* aOk = 0)
const;
626 Q_DECLARE_TYPEINFO(
BpsDecimal, Q_MOVABLE_TYPE);
Public include file for BPS CORE library macros.
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
BPSCORE_EXPORT QDataStream & operator<<(QDataStream &aStream, const BpsMargins &aMargins)
Write the margins to a stream.
BPSCORE_EXPORT QDataStream & operator>>(QDataStream &aStream, BpsMargins &aMargins)
Read the margins from a stream.
A class for decimal arithmetics.
Definition: bpsdecimal.h:87
BpsDecimal operator%(const BpsDecimal &aOther) const
Integer divide by other value and return remainder as result.
BpsDecimal & operator=(const QString &aString)
Assign value from a string.
BpsDecimal()
The default constructor initializes the value to NaN.
BpsDecimal operator--(int)
Postfix decrement the value by one.
BPSCORE_EXPORT uint qHash(const BpsDecimal &aValue, uint aSeed)
Returns a hash value, as required by QHash or QSet.
BpsDecimal max(const BpsDecimal &aOther) const
Compare this value with the other and return the larger (nearer towards +Infinity).
QString toString(int aDecPlaces, int aMaxSize=36) const
Converts a decimal value to a string of format [-]9.9.
BpsDecimal & operator=(quint32 aOther)
Assign value from a 32 bit unsigned integer.
BpsDecimal power(const BpsDecimal &aOther) const
Raises this value to the power of the other value and returns the result.
BPSCORE_EXPORT QDebug operator<<(QDebug aDebug, const BpsDecimal &aDecimal)
Write the string representation of a decimal value to a debug stream.
BpsDecimal(const char *aString)
Construct from a decimal string representation.
quint32 toUInt() const
Get the value as unsigned 32 bit integer.
BpsDecimal log10() const
Calculate the logarithm to base ten of this value and return the result.
bool operator==(const BpsDecimal &aOther) const
Compare with other value for equality.
BpsDecimal ceil() const
If the value is not integer, round up to next integer (towards +Infinity).
BpsDecimal & operator%=(const BpsDecimal &aOther)
Integer divide by other value and set remainder as value.
BpsDecimal(double aValue)
Construct from a double value.
bool isInfinite() const
Check if value is infinite.
BpsDecimal & operator++()
Prefix increment the value by one.
BpsDecimal(const QString &aString)
Construct from a decimal string representation.
bool operator<=(const BpsDecimal &aOther) const
Compare if less than or equal to other value.
BpsDecimal(const BpsDecimal &aOther)
The copy constructor.
BpsDecimal operator/(const BpsDecimal &aOther) const
Divide by other value and return result.
BpsDecimal & operator=(const BpsDecimal &aOther)
Assign value from an other decimal.
bool isNegative() const
Check if value is negative.
BPSCORE_EXPORT QDataStream & operator<<(QDataStream &aStream, const BpsDecimal &aDecimal)
Write the binary code of the decimal value to a data stream.
BpsDecimal floor() const
If the value is not integer, round down to next integer (towards -Infinity).
static BpsDecimal fromString(const char *aString, bool *aOk=0)
Convert a string to a decimal value.
BpsDecimal & operator/=(const BpsDecimal &aOther)
Divide by other value.
bool operator>=(const BpsDecimal &aOther) const
Compare if greater than or equal to other value.
BpsDecimal & operator=(const QByteArray &aString)
Assign value from a string.
BpsDecimal & operator*=(const BpsDecimal &aOther)
Multiply with other value.
BpsDecimal rounded(int aDecPlaces) const
Round to an number of decimal places.
BpsDecimal sqrt() const
Calculate the square root of this value and return the result.
BpsDecimal & operator=(const QVariant &aVariant)
Assign value from a QVariant.
BpsDecimal(qint32 aValue)
Construct from a signed 32 bit integer value.
bool operator>(const BpsDecimal &aOther) const
Compare if greater than other value.
BpsDecimal & operator-=(const BpsDecimal &aOther)
Subtract second value.
BpsDecimal & operator=(qlonglong aOther)
Assign value from a 64 bit signed integer.
static BpsDecimal fromString(const QString &aString, bool *aOk=0)
Convert a string to a decimal value.
BpsDecimal & operator+=(const BpsDecimal &aOther)
Add other value.
BpsDecimal & operator=(qint32 aOther)
Assign value from a 32 bit signed integer.
BpsDecimal & operator=(double aOther)
Assign value from a double.
BpsDecimal operator+(const BpsDecimal &aOther) const
Add two values and return result.
BpsDecimal & operator--()
Prefix decrement the value by one.
static BpsDecimal fromString(const QByteArray &aString, bool *aOk=0)
Convert a string to a decimal value.
qint32 toInt() const
Get the value as signed 32 bit integer.
BPSCORE_EXPORT BpsDecimal operator-(const BpsDecimal &aValue)
Unary prefix minus operator.
BPSCORE_EXPORT QTextStream & operator<<(QTextStream &aStream, const BpsDecimal &aDecimal)
Write the string representation of the decimal value to a text stream.
BpsDecimal(const QByteArray &aString)
Construct from a decimal string representation.
BpsDecimal down() const
If the value is not integer, round down to next integer (towards 0).
QString toString() const
Converts a decimal value to a string.
BPSCORE_EXPORT QDataStream & operator>>(QDataStream &aStream, BpsDecimal &aDecimal)
Read the binary code of the decimal value from a data stream.
BpsDecimal(quint32 aValue)
Construct from a unsigned 32 bit integer value.
bool isNaN() const
Check if value is not a number.
BpsDecimal(qulonglong aValue)
Construct from a 64 bit unsigned integer value.
BpsDecimal(const QVariant &aVariant)
Construct from a QVariant.
qulonglong toULongLong() const
Get the value as 64 bit unsigned integer.
BpsDecimal operator-(const BpsDecimal &aOther) const
Subtract second value and return result.
bool isInteger() const
Check if value is finite and has exponent=0.
BpsDecimal up() const
If the value is not integer, round up to next integer (away from 0).
bool operator<(const BpsDecimal &aOther) const
Compare if less than other value.
bool operator!=(const BpsDecimal &aOther) const
Compare with other value for un-equality.
BpsDecimal & operator=(const char *aString)
Assign value from a string.
BpsDecimal & operator=(qulonglong aOther)
Assign value from a 64 bit unsigned integer.
BpsDecimal operator++(int)
Postfix increment the value by one.
BpsDecimal ln() const
Calculate the natural logarithm (to base e) of this value and return the result.
double toDouble() const
Get the value as double.
BpsDecimal div(const BpsDecimal &aOther) const
Divides this value by the other value and returns the integer part of the result.
BpsDecimal exp() const
Calculate e to the power of this value and return the result.
BpsDecimal min(const BpsDecimal &aOther) const
Compare this value with the other and return the smaller (nearer towards -Infinity).
bool isFinite() const
Check if value is neither infinite nor a NaN.
QVariant toVariant() const
Explicit conversion to QVariant.
BPSCORE_EXPORT std::ostream & operator<<(std::ostream &aStream, const BpsDecimal &aDecimal)
Write the string representation of the decimal value to a std::ostream.
BpsDecimal(qlonglong aValue)
Construct from a 64 bit signed integer value.
qlonglong toLongLong() const
Get the value as 64 bit signed integer.
BpsDecimal operator*(const BpsDecimal &aOther) const
Multiply with other value and return result.