Author: random832
Description:
This is a request for a variant on "formatnum:" called "delimitnum:" which will include in its output span tags that can have a margin set on them to enable spaces to visually appear between digit groups to the right of the decimal point while not causing them to be in the resulting string when the number is selected and copied.
Each group of three digits, and a final group of two, three, or four digits, following the decimal point, should be output in a <span class="digitgroup"> tag, which should have a default style of .digitgroup { margin-left:0.25em }.
Multiple span tags are closed at the end of the number.
By "final group of two, three, or four digits", the following is meant:
1.2345
1.234 56
1.234 567
1.234 5678
1.234 567 89
The following additional parameters are also requested, in addition to the value to be formatted in the first parameter:
Second parameter - uncertainty (output in parentheses after the number if present)
Third parameter - power of ten (output × 10<sup>{{{3}}}</sup> after the number and uncertainty if present)
Fourth parameter - unit (output {{{4}}} if present)
So, the code
{{delimitnum:1.356392733|30|32|Hz}}
would have markup output of
1.356<span class="digitgroup">392</span><span class="digitgroup">733</span>(30) × 10<sup>32</sup> Hz
and the visual appearance of
1.356 392 733(30) × 10³² Hz
Discussion towards consensus for the use of this feature on enwiki can be found at:
http://en.wikipedia.org/wiki/Wikipedia_talk:Manual_of_Style_%28dates_and_numbers%29#Continuing_Discussion.2C_specifically_regarding_latest_nutshell_proposal
And an overview of the proposal being discussed can be found at:
http://en.wikipedia.org/wiki/Wikipedia_talk:Manual_of_Style_%28dates_and_numbers%29#Overview
The above-linked overview does not go into detail about where the span tags would be closed, and many of the examples provided there are not well-formed markup; I felt that having them surround each individual digit group (rather than all closing at the end of the numeric output, or at the end of the output of the tag) provides the most flexibility for user styles. This choice does not make any difference for the default appearance, as the default style proposed contains only a left margin.
The overview also does not propose the 'class="digitgroup"' convention, instead simply showing examples of tags with inline styles. However, it is better practice to use a class and control the specific styles with stylesheets so that users may override this style in their own user css.
Version: unspecified
Severity: enhancement