Crypto currencies frequently use numbers with uncommonly high precision. Dealing with these numbers is difficult for a variety of reasons:
- The precision of these numbers easily exceeds the ordinary limits of software. For example, although 32 bit ints are ubiquitous, they are not big enough to do the job.
- There are usually several layers of software working together in a stack. Figuring this out with just one piece of the stack is not enough. Our solution must satisfy all the members of the stack.
- We must understand rounding and round-off error.
- We must understand the difference between storage and internal manipulation of the numbers vs. presentation in a UI.
The bookwerx-core-rust and bookwerx-ui-elm products are permeated with these issues. In this essay I will describe one particular solution and explore the choices we had and the reasoning behind the choices we took.