Money
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Rappresenta un importo di denaro con il tipo di valuta.
Rappresentazione JSON |
{
"currencyCode": string,
"units": string,
"nanos": integer
} |
Campi |
currencyCode |
string
Il codice valuta di tre lettere definito in ISO 4217.
|
units |
string (int64 format)
Le unità intere dell'importo. Ad esempio, se currencyCode è "USD" , 1 unità equivale a un dollaro statunitense.
|
nanos |
integer
Numero di nano (10^-9) unità della quantità. Il valore deve essere compreso tra -999.999.999 e +999.999.999 (inclusi). Se units è positivo, nanos deve essere positivo o zero. Se units è zero, nanos può essere positivo, zero o negativo. Se units è negativo, nanos deve essere negativo o zero. Ad esempio -1,75 $ è rappresentato come units =-1 e nanos =-750.000.000.
|
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[null,null,["Ultimo aggiornamento 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"]]