Money
Представляет сумму денег с типом валюты.
JSON-представление |
---|
{
"currencyCode": string,
"units": string,
"nanos": integer
} |
Поля |
---|
currency Code | string Трехбуквенный код валюты, определенный в ISO 4217. |
units | string ( int64 format) Целые единицы суммы. Например, если currencyCode равен "USD" , то 1 единица равна одному доллару США. |
nanos | integer Количество нано (10^-9) единиц суммы. Значение должно находиться в диапазоне от -999 999 999 до +999 999 999 включительно. Если units положительны, nanos должен быть положительным или нулевым. Если units равны нулю, nanos может быть положительным, нулевым или отрицательным. Если units измерения отрицательные, nanos должно быть отрицательным или нулевым. Например, -1,75 доллара США представлены как units = -1 и nanos = -750 000 000. |
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2024-11-27 UTC.
[null,null,["Последнее обновление: 2024-11-27 UTC."],[[["JSON is used to represent monetary amounts with their currency type."],["The representation includes the currency code (ISO 4217), whole units, and nano units for precision."],["`units` and `nanos` must adhere to specific rules based on their values to ensure accurate representation."],["The `currencyCode` follows the ISO 4217 standard using a three-letter code."]]],["The core content defines a JSON structure for representing monetary amounts. It includes three fields: `currencyCode` (a string for the three-letter currency code), `units` (a string representing whole units of the currency), and `nanos` (an integer for the fractional nano-units). The `nanos` value must adhere to constraints based on the sign of `units` and is used for precision in amounts. The amount value is based on those three elements.\n"]]