docs/src/reference-main-number-formatting.md
The command-line option --ofmt {format string} is the global number format for all numeric fields. Examples:
These are just familiar printf formats -- as of Miller 6.0.0, supported options are those at
https://pkg.go.dev/fmt. Additionally, if you use leading width (e.g.
%18.12f) then the output will contain embedded whitespace, which may not be what you want if you
pipe the output to something else, particularly CSV. I use Miller's pretty-print format (mlr --opprint) to column-align numerical data.
To separately specify formatting for string, int, and float fields, you can use
the format-values verb -- see that section for examples.
To apply formatting to a single field, you can also use
fmtnum function within mlr put. For example:
Input conversion from hexadecimal is done automatically on fields handled by mlr put and mlr filter as long as the field value begins with 0x. To apply output conversion to hexadecimal on a single column, you may use fmtnum, or the keystroke-saving hexfmt function. Example: