Template:Gapnum

The formatter Template:Gapnum formats a number by inserting small gaps (rather than commas) between each 3-digit group, with the decimal portion displayed in groups of 3 or 4 decimal digits. The gap size can be set by: gap=3px (default: gap=0.25em).

Usage

 * {&#123;Gapnum |34000.123456}}  &rarr;
 * {&#123;Gapnum |7100.123000777|gap=11px}}  &rarr;
 * {&#123;Gapnum |7100.123000777|prec=5}}  &rarr;

This template formats any number to have space gaps, showing a specified number of decimal digits. It shows the decimal digits in groups of 3 or 4, separated by narrow spaces (small gaps), as the left-margin space of digit groups.

Parameters
Parameter 1 is a number (with no embedded spaces), to display with gaps.

Parameter prec=5 (optional) is the number of decimals to display (the count of digits after the decimal point), and can be less, or more than the actual number to show trailing zeroes.

Parameter gap=3px sets the gap between digit groups (default: gap=0.25em).

Performance impact
The template cannot process numbers with a trailing space, unless the precision prec=n is specified (due to processing restrictions in Template:Getprecision). The expansion depth limit is 10, by default, or 5 levels if precision prec=n is set.