Development
...
SignumJS
Basics
Token Quantities
1min
Tokens (also called Assets) can have an arbitrary divisibility from zero up to eight decimals. While Amount is meant to be used for Signa and Planck and fixed to eight decimals, another - more generic - value object class for arbitrary decimals is needed: ChainValue
Token amounts are called quantities and the Node HTTP API always returns the token quantities the suffix QNT. See an example here
So, a Token FOO can have four decimals, which would result in
1 FOO = 10,000 FOOQNT 1 FOOQNT = 0.0001 FOO
Similar to Amount SignumJS provides a value object class calls ChainValue and allows to convert and calculate with quantities.
Updated 03 Mar 2023
Did this page help you?