Units: A Unit Conversion Program and Scientific Calculator: Numeric Output Format

Next: Localization, Previous: Defining Your Own Units, Up: Top [Contents][Index]

## 11 Numeric Output Format

By default, `units` shows results to eight significant digits. You can change this with the `--exponential`, `--digits`, and `--output-format` options. The first sets an exponential format (i.e., scientific notation) like that used in the original Unix `units` program, the second allows you to specify a different number of significant digits, and the last allows you to control the output appearance using the format for the `printf()` function in the C programming language. If you only want to change the number of significant digits or specify exponential format type, use the `--digits` and `--exponential` options. The `--output-format` option affords the greatest control of the output appearance, but requires at least rudimentary knowledge of the `printf()` format syntax. See Invoking Units, for descriptions of these options.