[#CalculatePercentilesByWeight]
= CalculatePercentilesByWeight
:mrdocs:

Used by getblockstats to get feerates at different percentiles by weight

== Synopsis

Declared in `&lt;rpc&sol;blockchain&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
CalculatePercentilesByWeight(
    xref:CAmount.adoc[CAmount] result[],
    std::vector&lt;std::pair&lt;CAmount, int64&lowbar;t&gt;&gt;& scores,
    int64&lowbar;t total&lowbar;weight);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *result*
| Output array filled with the fee rate at each percentile&period;
| *scores*
| The (fee, weight) pairs to compute percentiles from&period;
| *total&lowbar;weight*
| The total weight across all `scores&period;`
|===


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