Skip to content

Add thousand separators to meshing utility output

Functionality to add/problem to solve

Adding thousand separators to the output so it's easier for human to read long integers.

Target audience

All meshing utilities (and probably some other applications)

Proposal

Add some code to messageStream when printing integers

What does success look like, and how can we measure that?

For example the current output of blockMesh is like

Mesh Information
----------------
  boundingBox: (0 -0.0005 0) (0.012 0.0005 5e-05)
  nPoints: 4911759
  nCells: 4729600
  nFaces: 14369360
  nInternalFaces: 14008240
----------------

Adding thousand separators to integers will make it much easier to read.

Mesh Information
----------------
  boundingBox: (0 -0.0005 0) (0.012 0.0005 5e-05)
  nPoints: 4,911,759
  nCells: 4,729,600
  nFaces: 14,369,360
  nInternalFaces: 14,008,240
----------------

Links / references

You don't need to write any code to parse numbers. C++ has built-in functions to do that. https://cplusplus.com/reference/locale/numpunct/

Edited by Guanyang Xue