Convert amount storage unit to be Grammes instead of Kilogrammes
Describe the improvement The use of KG as the base storage unit for amounts creates small fractions which can encounter problem with the edges of double precision. For example a Vehicle can have a capacity of 20KG but if it is continuously loaded with amounts that have a very long precision the total will not equal the original capacity.
To improve the situation, use the base unit of Grams and do not allow anything smaller than a gramme; hence this will allow integer arithmetic to be used an precision problems will be removed.
Coding is straight forward but there will be calculation functions that need to be converted from KG to G. This will allow us to represent the large amount as 2,147 metric tonnes (or 2147483 KG). I think this is sufficient. We could use unsigned ints to double the maximum BUT unsigned ints can be difficult to work with since you have to guarantee it never goes negative.
But there are microscopic amount resources such as the bacteria for decomposing those black water that could go below a gram, or in testing the quality of water by adding some amount of chlorine in a small sample of water , etc
Good point
What if those were stored diluted, to simplify measurement internally? For adding small amounts of chlorine or bacteria, this may make the process easier.
That's an interesting idea. Of course the transition from kg to grammes would be a big change so we need to be sure we have thought of everything.
Going to close this as it's not possible in the current module because we cannot represent the very small values and the large values.