Sample program TSTNUMFOR (source online here) illustrates the use of built-in numeric formats (NUMFMT_xxx) and also custom masks. The raw value is shown in the first column, the format code or mask in the center, and the formatted value on the right.