Money
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Reprezentuje kwotę za pomocą jej 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 jednostka kwoty. Jeśli na przykład currencyCode to "USD" , 1 jednostka to 1 zł.
|
nanos |
integer
Liczba jednostek nano (10^-9) ilości. Wartość musi mieścić się w zakresie od -999 999 999 do +999 999 999 włącznie. Jeśli units ma wartość dodatnią, nanos musi być liczbą dodatnią lub zero. Jeśli units ma wartość 0, nanos może być liczbą dodatnią, zerową lub ujemną. Jeśli units ma wartość ujemną, nanos musi mieć wartość ujemną lub zero. Na przykład -1,75 zł jest przedstawione 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: 2025-07-27 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-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"]]