Parse number as fixed point according to JSON number syntax.
Declared in <util/strencodings.h>
[[nodiscard]]
bool
ParseFixedPoint(
std::string_view val,
int decimals,
int64_t* amount_out);
The result must be in the range (-10^18,10^18), otherwise an overflow error will trigger.
| Name | Description |
|---|---|
| val | The string to parse. |
| decimals | Number of digits after the decimal point in the fixed-point result. |
| amount_out | Set to the parsed value scaled by 10^decimals on success. |