সাঁচ:Nts

অসমীয়া ৱিকিপিডিয়াৰ পৰা

This template can be useful when building a sortable table in which a column contains both numbers and text. This template should be applied to every number in the column.

Currently, the template works for numbers less than or 10,000,000,000,000,000 (1×1016) and greater than -10,000,000,000,000,000 (-1×1016). Numbers outside this range will sort above or below other numbers depending on sign. See the Limitations section below.

By default the output is displayed using thousands separators. To display numbers as entered, use |format=no.

The template generates a hidden "sort key" in the HTML markup which forces the Javascript sorting algorithm to sort the column alphabetically.

Purpose[সম্পাদনা কৰক]

There are at two cases where this template is useful:

  1. When numbers are followed by some text
  2. When numbers are preceded by some text other than a currency symbol.

Parameters[সম্পাদনা কৰক]

The template has only one required parameter: a real number. These examples use the name of the redirect, {{nts}}, for brevity.

Optional parameters
  • prefix: To display some text before the number, use |prefix=some prefix
    {{nts|123456789.00123|prefix=approx. }}&0000000123456789.00123012,34,56,789.00123
  • format: To retain a number's format, use |format=no
    {{nts|123456789.00123}}&0000000123456789.00123012,34,56,789.00123
    {{nts|123456789.00123|format=no}}&0000000123456789.00123012,34,56,789.00123
  • debug: To display the sort key, use |debug=yes.
    {{nts|123456789.00123|debug=yes}}&0000000123456789.00123012,34,56,789.00123
    {{nts|-123456789.00123|debug=yes}}&-1-1-1-1-1-1-1-2-3-4-5-6-7-8-90.998770−12,34,56,789.00123

Apart from the added thousands separators the numbers are formatted as supplied (scientific notation or not, leading and trailing zeros, and a zero before the decimal point or not). This formatting does not affect the sorted order except for numbers not satisfying the limitations mentioned below.

Limitations[সম্পাদনা কৰক]

  • Any subset of numbers larger than 1×1016 are sorted as greater than 1×1016 but this subset is sorted alphabetically.
  • Any subset of numbers smaller than -1×1016 are sorted as less than -1×1016 but this subset is sorted alphabetically.
  • If a non-numeric value is given as the first unnamed parameter the results are undefined.
  • There is a maximum of 6 digits after the decimal separator. Positive numbers with more than 6 decimal digits should sort correctly but the results for negative numbers with more that 6 decimal digits is undefined.
  • A prefix (using the prefix parameter) does not affect the sort order.

Examples[সম্পাদনা কৰক]

{{nts|123456789.00123}}<span style="display:none">&0000000123456789.001230</span>123,456,789.00123

For text which follows a number, {{nts|123,456}} as of 2012 displays 123,456 as of 2012 with a numerical sort key of 123456. This forces numerical sorting in the cell using this value instead of the default alphabetical sorting.

Below are more examples, some of which illustrate the limitations listed above.

markup sortkey and number error spillover
{{nts|debug=yes}} &এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{".এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত বিৰামচিহ্ন কেৰেক্টাৰ "{"{{{1}}}
{{nts||debug=yes}} &এক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰএক্সপ্ৰেছন ত্ৰুটী: অবাঞ্চিত / অপাৰেটৰ-1.0000-0
{{nts|between 2 and 3|debug=yes}} &এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between".এক্সপ্ৰেছন ত্ৰুটী: অপৰিচিত শব্দ "between"between 2 and 3
{{nts|10|prefix=approx.{{sp}}|debug=yes}} &0000000000000010.00000010
{{nts|-5|debug=yes}} &-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-6.1000000−5
{{nts|-4|debug=yes}} &-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-5.1000000−4
{{nts|-73|debug=yes}} &-1-1-1-1-1-1-1-1-1-1-1-1-1-1-8-4.1000000−73
{{nts|-67|debug=yes}} &-1-1-1-1-1-1-1-1-1-1-1-1-1-1-7-8.1000000−67
{{nts|-20345678901234567.12345678|debug=yes}} &-1-4-5-6-7-8-90-1-2-3-4-5-6-7-8.432000000−20,34,56,78,90,12,34,570.00000000
{{nts|123.456e3|debug=yes}} &0000000000123456.0000001,23,456
{{nts|123.456e2|debug=yes}} &0000000000012345.60000012,345.6
{{nts|20345678901234567.12345678|debug=yes}} &0345678901234568.-43200000020,34,56,78,90,12,34,570.00000000
{{nts|100345678901234567.12345678|debug=yes}} &0345678901234560.45600000001,00,34,56,78,90,12,34,560.00000000
{{nts|1234567890123456.12345678|debug=yes}} &1234567890123455.-440000001,23,45,67,89,01,23,456.00000000
{{nts|234567890123456.12345678|debug=yes}} &0234567890123456.-390625023,45,67,89,01,23,456.12000000
{{nts|34567890123456.12345678|debug=yes}} &0034567890123456.1250003,45,67,89,01,23,456.12500000
{{nts|4567890123456.12345678|debug=yes}} &0004567890123456.12304745,67,89,01,23,456.12300000
{{nts|567890123456.12345678|debug=yes}} &0000567890123456.1234135,67,89,01,23,456.12340000
{{nts|67890123456.12345678|debug=yes}} &0000067890123456.12345967,89,01,23,456.12346000
{{nts|7890123456.12345678|debug=yes}} &0000007890123456.1234577,89,01,23,456.12345700
{{nts|890123456.12345678|debug=yes}} &0000000890123456.12345789,01,23,456.12345680
{{nts|90123456.12345678|debug=yes}} &0000000090123456.1234579,01,23,456.12345678
{{nts|0123456.12345678|debug=yes}} &0000000000123456.12345701,23,456.12345678
{{nts|123456.12345678|debug=yes}} &0000000000123456.1234571,23,456.12345678
{{nts|23456.12345678|debug=yes}} &0000000000023456.12345723,456.12345678
{{nts|3456.12345678|debug=yes}} &0000000000003456.1234573,456.12345678
{{nts|456.12345678|debug=yes}} &0000000000000456.123457456.12345678
{{nts|56.12345678|debug=yes}} &0000000000000056.12345756.12345678
{{nts|6.12345678|debug=yes}} &0000000000000006.1234576.12345678
{{nts|.12345678|debug=yes}} &0000000000000000.123457.12345678
{{nts|0.12345678|debug=yes}} &0000000000000000.1234570.12345678
{{nts|0.02345678|debug=yes}} &-1000000000000000.0234570.02345678
{{nts|0.00345678|debug=yes}} &-1-100000000000000.0034570.00345678
{{nts|0.00045678|debug=yes}} &-1-1-10000000000000.0004570.00045678
{{nts|0.00005678|debug=yes}} &-1-1-1-1000000000000.0000570.00005678
{{nts|0.00000678|debug=yes}} &-1-1-1-1-100000000000.0000070.00000678
{{nts|0.00000078|debug=yes}} &-1-1-1-1-1-10000000000.0000010.00000078
{{nts|0.00000008|debug=yes}} &-1-1-1-1-1-1-1000000000.0000000.00000008
{{nts|.00000008|debug=yes}} &-1-1-1-1-1-1-1000000000.000000.00000008
{{nts|0|debug=yes}} &-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1.0000000

See also[সম্পাদনা কৰক]

  • {{Ntsh}} - same as this template, but does not display (hides) the number
  • {{Ntsc}} - for converted units, sorts by the first number
  • {{Ntss}} - same as Nts, but allows for the number to be scaled
  • {{Convert}} - has a sortable option
  • {{Dts}} - for sorting dates
  • {{Sms}}