- Preparing search index...
- The search index is not available
cardstack
Function convertAmountFromNativeValue
- convertAmountFromNativeValue(value: Value, priceUnit: null | Value, decimals?: number): string
-
Parameters
-
value: Value
-
priceUnit: null | Value
-
decimals: number = 18
Returns string
Calculates
value / priceUnit
, rounded down to specifieddecimals
(default 18). Handles division by zero by returning zero