[#CompressAmount]
= CompressAmount
:mrdocs:

Compress amount&period;

== Synopsis

Declared in `&lt;compressor&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
uint64&lowbar;t
CompressAmount(uint64&lowbar;t nAmount);
----

== Description

nAmount is of type uint64&lowbar;t and thus cannot be negative&period; If you&apos;re passing in a CAmount (int64&lowbar;t), make sure to properly handle the case where the amount is negative before calling CompressAmount(&period;&period;&period;)&period;

== Return Value

The compressed amount encoding&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *nAmount*
| The amount in satoshis to compress&period;
|===

== Preconditions

* Function defined only for 0 &lt;&equals; nAmount &lt;&equals; MAX&lowbar;MONEY&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
