MK Code - Mask Metric
The MK code allows you to display large numbers in a few columns using letters for various powers of 10.
Input Conversion
Input conversion does not invert. It simply applies the metric processing to the input data.
Syntax
MKn
Syntax Elements
n Field size: how many characters are to be output. This includes the letter and a minus sign, if present.
If a number fits in the specified field, the code displays
the number unchanged. If the number is too long and includes a decimal fraction,
the code tries to round the fraction to fit the field. If the field is too small
to display the fraction, the code rounds off the three low-order integer digits,
replacing them with the letter K (representing 103). If the number is still too long, the code rounds off
the next three digits, replacing them with M (106). If that is still too long, the
code rounds off three more digits, replacing them with G (109). If the number still
does not fit the specified field, the code displays an asterisk.
If the field size is not specified or is zero, the code outputs null.
Examples
|
Internal Data |
Output from Codes |
|||
|---|---|---|---|---|
|
MK3 |
MK4 |
MK5 |
MK7 |
|
|
999.9 |
1K |
1000 |
999.9 |
999.9 |
|
1234 |
1K |
1234 |
1234 |
1234 |
|
123456789 |
* |
123M |
123M |
123457K |
|
123456789012345 |
* |
* |
* |
123457G |
|
-12.34567 |
-12 |
-12 |
-12.3 |
-12.346 |
|
-1234.5678 |
-1K |
-1K |
-1235 |
-1234.6 |