-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Turns out FA1.2 tokens (and FA2 onwards) do have decimal places even though the specification doesn't require a definition for it. They will follow exactly the same pattern as Tez. They will only be represented by 1 natural number, with a piece of metadata indicating how many decimal places exist. The tokens will have variable decimal places however.
It would be great to have a Tez subclass, or alias that has a configurable decimal place. It should follow all the same logic (e.g. passing in a string will be the rpc representation, passing in a double would be the higher order representation).
Other requirements:
-
Being able to multiply Tez and NativeToken if they are separate objects) by a
doubleorDecimal. Giving the ability to be able to display the local currency value of the token without having to cast to other objects. -
Being able to add Tez and NativeToken together (if they are separate objects). To have the ability to multiply all of the Tez and Tokens by their local currency amount, and then add all of them together to get a wallet/account total. Again without having to cast to intermediate objects. Leading rounding/truncation issues.