First, the FIXED_UNITS package requires some options that can't easily be selected using generic parameters. Sure, I could use generic parameters for the number of digits, minimum, and maximum values, but there are more decisions that need to be made. For example, sooner or later you will have to convert the value to a character string of many digits. Do you want to separate digits by commas, periods, or underlines? There are even more difficult decisions to be made regarding the location of the decimal point after arithmetic operations. I just couldn't guess what you would want, so I didn't try.
Second, I don't think the FIXED_UNITS package is necessary, and it might not even be a good idea. If I wrote a FIXED_UNITS package and included it with INTEGER_UNITS and FLOAT_UNITS, then it would encourage people to use FIXED_UNITS when they probably should use INTEGER_UNITS or FLOAT_UNITS. I don't like to encourage the use of fixed- point arithmetic.
There is an optional pragma you could use to specify Dollars'SMALL, but it might not be supported on the compiler you want to use. Even if it is, whenever you depend on pragmas to make your program work, you are asking for portability problems.
The LRM gives the vendors so much freedom when it comes to implementing fixed-point types, you can't be sure what you are getting. DEC Ada just uses a 32 bit integer, and interprets the LSB as the delta value. That means DEC Ada could represent the type Dollars described above perfectly, but could not represent Big_Bucks if type Big_Bucks is delta 0.01 range -22_000_000.00 .. 22_000_000.00; because that exceeds the range of values that can be represented by 32 bits.
I have never found a situation where Ada's fixed-point data type was useful. If I need nine or fewer digits of range, with one digit of absolute accuracy, then I can use Integer_32. Just for the sake of argument, suppose there was a situation where I needed 50 digits of range with one digit of accuracy, then the implementation of Ada's fixed-point type probably wouldn't be sufficient to support that many digits anyway. Even if it did, I couldn't be sure I would get the accurate results from it.
Most students use the same Binary Coded Decimal (BCD) approach that 4-bit hand-held calculators use. This involves creating an array of digits that represents the number. Arithmetic operators process the numbers one digit at a time, just like you would if you were adding two long numbers using paper and pencil. They use hidden variables with names like CARRY, BORROW, and PARTIAL_PRODUCT to hold some intermediate results. A boolean variable tells if the value is positive or negative, and another integer tells where the decimal point is.
It isn't very efficient to use a 16- or 32-bit computer to process numbers 4 bits at a time, so some students use an integer to represent a group of three or four digits. The technique is basically the same as BCD, but the computer does several digits at a time, so it is more efficient.
Perhaps the most difficult part of these two approaches is converting arrays of digits to character strings, and vice versa. This sometimes leads a third group of students to use a character string as the private type representing the long number. They still process the data one digit at a time, but instead of arrays of integers they use arrays of characters and define special operations that work on characters.
If you want to be able to multiply a monetary figure (which has two decimal places) by 6.5% sales tax (three decimal places), then your private type will have to have a "floating decimal point" so it can represent numbers to two or three (or any other number) or decimal places.
If you allow a floating decimal point it raises some interesting problems. For example, If you subtract 0.123 from 0.9, you will have to move the decimal point before you find the difference. Once you have performed the subtraction, should the answer be 0.777 or 0.8?
The problems with fixed-point arithmetic make it more trouble than it is worth. I think you would be better off to avoid fixed-point arithmetic whenever you can.
Fixed-point computers are no longer in vogue, but they are still in some military systems. An Ada compiler for a fixed-point target computer might take advantage of certain machine features if you declare real data types to be fixed- point types with deltas that are a power of 2. I haven't used an Ada compiler for a fixed-point computer, so I don't know what it does, but you may want to look into it you find yourself in that situation.