| Home · All Classes · All Namespaces · Modules · Functions · Files

Public Attributes
Tp::CurrencyAmount Struct Reference
Structure types

`#include <TelepathyQt/Types>`

List of all members.

## Public Attributes

- int amount
- uint scale
- QString currency

## Detailed Description

Structure type generated from the specification.

An amount of money in a specified currency. For example, 3.21 British pounds would conventionally be represented by (Amount = `321`, Scale = `2`, Currency = `"GBP"`), but could be represented by (Amount = `3210`, Scale = `3`, Currency = `"GBP"`) in a service that records balance in units of 0.001 pounds.

As a special case, if Amount = `0`, Scale = `2**32 - 1` (i.e. the largest possible 32-bit unsigned integer) and Currency = `""`, this indicates an unknown amount.

## Member Data Documentation

int Tp::CurrencyAmount::amount

The amount, expressed as a fixed-point number with decimal scale defined by the Scale field; for instance, an Amount value of `1234` with Scale of `2` represents 12.34 in the currency unit given by the Currency field.

uint Tp::CurrencyAmount::scale

The decimal scale for the fixed point value of the Amount field, defining the number of rightmost decimal digits from the integer value which form the fractional part of the resulting currency value.

As well as defining the interpretation of Amount, user interfaces may use this value to determine the precision with which to display the amount.

QString Tp::CurrencyAmount::currency

The currency code represented by this amount, which SHOULD be an international currency code such as "EUR", "USD", or "JPY" if possible. An empty string can be used to indicate that the currency is not known.