साँचा:Nts/doc

मुक्त ज्ञानकोश विकिपीडिया से
नेविगेशन पर जाएँ खोज पर जाएँ

{{

 साँचा:namespace detect

| type = notice | image = | imageright = | class = | style = margin-bottom:1.0em; | textstyle = | text = साँचा:strong for साँचा:terminate sentence
It contains usage information, categories and other content that is not part of the original साँचा page. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }} साँचा:mbox Similar to Dts, Nts/doc stands for Number Table Sorting and is used to display numbers with thousands separator in a sortable table and have them numerically sorted in alphabetic sort mode.

What it solves

Formerly, for table sorting to function correctly, numbers had to be entered with not more than one thousands separator. As a workaround alphabetic sorting mode was applied, and the numbers provided with a hidden part so that alphabetic sorting corresponded with numeric sorting.

Since a mix in one column of numbers formatted for alphabetic sorting and plain numbers does not allow proper sorting, adding a number in an existing table may require putting it in the format used in that column. Also, if some table cells in a column contain text after the number, or if the numbers are preceded by some fixed text other than a currency symbol, alphabetic sorting mode is needed.

This template automatically creates the hidden <span style="display:none">&&&&&&&0123456789.&&1230</span> 123,456,789.00123 before the actual displayed number. It forces the sorting routine to use text sort on the hidden segment, which functions correctly due to the preceding ampersands (currently till 16 digits before, and 6 digits after the decimal separator).

Negative numbers do not sort correctly with this template.

Parameters

The template has only one parameter: a real number without thousand separators.

Input

{{Nts|123456789.00123}}

Output

Output sent to table

 <span style="display:none">&&&&&&&0123456789.&&1230</span> 123,456,789.00123 

Output displayed to user
&&&&&&0123456789.&&1230१२,३४,५६,७८९.००१२३

See also