Function parseKLV
Parameters
- amount: string | number
Human-readable KLV amount
Returns bigint
Amount in smallest units as bigint
Example
parseKLV('1') // 1000000n (1 KLV)
parseKLV('1.5') // 1500000n (1.5 KLV)
parseKLV(2) // 2000000n (2 KLV)
parseKLV('0.000001') // 1n (smallest KLV unit)See
- parseUnits for the underlying implementation
- formatKLV for the reverse operation
- amount: string | number
Parse KLV amount from human-readable string to smallest units
Convenience function that calls
parseUnits
with 6 decimals (KLV precision).