Bahaipedia
Bahaipedia
Menu
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Tools
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
Page information
Template
Discussion
View history
Talk
Contributions
Create account
Log in
Navigation
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Learn more
Core topics
Bahá’í Faith
Central Figures
Teachings
Practices
Tools
What links here
Related changes
Upload file
Special pages
Printable version
Permanent link
Page information
Translations

Template:Ntsh

From Bahaipedia
Jump to:navigation, search
Template documentation[view] [edit] [history] [purge]

Ntsh (Number Table Sorting, Hidden) is the hidden version of Nts, for correctly sorting tables by their numeric columns. It does the same as Nts, except that it doesn't display anything visible. It can be used to prefix non-numeric entries; for example, you can write {{ntsh|0}}None to have the entry to the end of the table when sorting numerically using Nts.

Contents

  • 1 What it solves
  • 2 Parameters
    • 2.1 Input
    • 2.2 Output
  • 3 See also

What it solves[edit]

To use Help:Sorting and have it function correctly, numbers must be entered without thousands separators. To enable the display of thousands separators, this template automatically creates the hidden <span style="display:none">&&&&&&&123456789.&&1230</span> 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).

Parameters[edit]

Only one: a real number without thousand separators.

Input[edit]

{{Ntsh|123456789.00123}}

Output[edit]

Output sent to table

 <span style="display:none">&&&&&&&123456789.&&1230</span>

No output is displayed to the user.

See also[edit]

  • Template:Nts
  • Template:Lsc11- using non-breaking spaces instead of ampersands in a similar fashion
The above documentation is transcluded from Template:Ntsh/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://bahaipedia.org/index.php?title=Template:Ntsh&oldid=20739"
Category:
  • Sorting templates
This page was last edited on 10 April 2008, at 15:29.
Text is available under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
Privacy policy
About Bahaipedia
Disclaimers
Powered by MediaWiki