Money
Reprezentuje kwotę pieniędzy z typu waluty.
Zapis JSON |
{
"currencyCode": string,
"units": string,
"nanos": integer
} |
Pola |
currencyCode |
string
Trzyliterowy kod waluty zdefiniowany w normie ISO 4217.
|
units |
string (int64 format)
Całkowita kwota. Jeśli na przykład currencyCode ma wartość "USD" , to 1 jednostka to 1 dolar amerykański.
|
nanos |
integer
Liczba nano (10^-9) jednostek wartości. Wartość musi się mieścić w przedziale od -999 999 999 do +999 999 999. Jeśli units jest dodatnia, nanos musi być dodatnia lub równa zero. Jeśli units = 0, nanos może być dodatnia, równa zero lub ujemna. Jeśli units jest ujemna, nanos musi być ujemna lub równa zero. Na przykład wartość -1,75 USD jest reprezentowana jako units =-1 i nanos =-750 000 000.
|
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-12-17 UTC.
[null,null,["Ostatnia aktualizacja: 2024-12-17 UTC."],[[["Money is represented using a JSON object with currency code, whole units, and nano units."],["Currency is specified by a three-letter ISO 4217 code like \"USD\"."],["The `units` field stores the whole currency units, while `nanos` stores fractional units (10^-9)."],["`nanos` value must be within -999,999,999 to +999,999,999 and its sign must align with the sign of `units`."]]],["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"]]