Open
Description
What's the recommended way to create Typescript types for sub types of Big with different configs?
I'd like to have unique types for USD vs BTC, mainly to easily identify the value's expected decimal/rounding behavior, that have different configs like so:
USD.DP = 2; // Maximum 2 decimal places for USD
USD.RM = Big.roundHalfUp; // Round to nearest neighbor, away from zero if equidistant
USD.NE = -3; // Exponential notation for values < 0.01
BTC.DP = 8; // Maximum 8 decimal places for BTC
BTC.RM = Big.roundDown; // Round towards zero
BTC.NE = -9; // Exponential notation for values < .00000001.
I've tried a few different methods but none seem to work, either theres type errors or the rounding / precision configs dont seem to take effect.
Metadata
Assignees
Labels
No labels
Activity