The amount of money in decimal format. This is an abstraction of the Units and Nanos properties.
Getting this property combines those property values, and setting this property will set both of those properties.
Number of nano (10^-9) units of the amount.
The value must be between -999,999,999 and +999,999,999 inclusive.
If units is positive, nanos must be positive or zero.
If units is zero, nanos can be positive, zero, or negative.
If units is negative, nanos must be negative or zero.
For example $-1.75 is represented as units=-1 and nanos=-750,000,000.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eMoney\u003c/code\u003e class represents a monetary amount with a specified currency type, aligning with ISO 4217 standards for currency codes.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, ensuring robust functionality and compatibility within the .NET ecosystem.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMoney\u003c/code\u003e class stores monetary values through \u003ccode\u003eUnits\u003c/code\u003e (whole units) and \u003ccode\u003eNanos\u003c/code\u003e (fractional units), which can be accessed collectively via the \u003ccode\u003eDecimalValue\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eConstructors are provided to create new \u003ccode\u003eMoney\u003c/code\u003e instances, either empty or by cloning another \u003ccode\u003eMoney\u003c/code\u003e object, allowing for flexibility in object initialization.\u003c/p\u003e\n"],["\u003cp\u003eIt has multiple methods such as \u003ccode\u003eClone()\u003c/code\u003e, \u003ccode\u003eEquals()\u003c/code\u003e, \u003ccode\u003eMergeFrom()\u003c/code\u003e and \u003ccode\u003eToString()\u003c/code\u003e that provide functions to modify, compare and create deep clones of the \u003ccode\u003eMoney\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["# Class Money (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Money)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Type.Money)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Type.Money)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Type.Money) \n\n public sealed class Money : IMessage\u003cMoney\u003e, IEquatable\u003cMoney\u003e, IDeepCloneable\u003cMoney\u003e, IBufferMessage, IMessage\n\nRepresents an amount of money with its currency type. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Money \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Money](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Money), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Money](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Money), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Money](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type.Money), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Type](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Type)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### Money()\n\n public Money()\n\n### Money(Money)\n\n public Money(Money other)\n\nFields\n------\n\n### CurrencyCodeFieldNumber\n\n public const int CurrencyCodeFieldNumber = 1\n\nField number for the \"currency_code\" field.\n\n### NanosFieldNumber\n\n public const int NanosFieldNumber = 3\n\nField number for the \"nanos\" field.\n\n### UnitsFieldNumber\n\n public const int UnitsFieldNumber = 2\n\nField number for the \"units\" field.\n\nProperties\n----------\n\n### CurrencyCode\n\n public string CurrencyCode { get; set; }\n\nThe three-letter currency code defined in ISO 4217.\n\n### DecimalValue\n\n public decimal DecimalValue { get; set; }\n\nThe amount of money in [decimal](https://learn.microsoft.com/dotnet/api/system.decimal) format. This is an abstraction of the Units and Nanos properties.\nGetting this property combines those property values, and setting this property will set both of those properties.\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Nanos\n\n public int Nanos { get; set; }\n\nNumber of nano (10\\^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.\n\n### Parser\n\n public static MessageParser\u003cMoney\u003e Parser { get; }\n\n### Units\n\n public long Units { get; set; }\n\nThe whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public Money Clone()\n\n### Equals(Money)\n\n public bool Equals(Money other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### MergeFrom(Money)\n\n public void MergeFrom(Money other)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]