| Vorlagenprogrammierung | Diskussionen | Lua | Test | Unterseiten | |||
| Modul | Deutsch | English | Modul: | Dokumentation | |||
Sort/cellNum – Module with functions for generation of sortable number values in tables and for advanced number formatting.
#invoke – all optional:
. as decimal separator expected, but local project decimal separator is valid as well.1.234E56 for exponential representation (base 10) is also possible. This will trigger presentation with the same exponential number.. as decimal separator will precede.01 then precede required table syntax for sortable number values.<span> if necessary." are not permitted.ltr or rtl2025-01-271 – required version, or keyword wikidata or keyword ~2025-01-27) when keyword wikidata~ and a registered version on Wikidata is the same as local; otherwise local version ID ()×10 the letter E will be copied, which yields to a common format for many programming languages.All functions described above can be used by other modules:
local lucky, Sort = pcall( require, "Module:Sort/cellNum" )
if type( Sort ) == "table" then
Sort = Sort.Sort()
else
-- failure; Sort is the error message
return "<span class=\"error\">" .. Sort .. "</span>"
end
Subsequently there are available:
f1 → true1 → truemw.html object, which will be attributed and filled with content.frame, if at hand; otherwise nilcell object"~" or "wikidata"The module is working for all languages and number formattings, even for right -to-left scripting. Grouping (thousands or other) is derived automatically from local project; mostly 3, but some cultures use 4 or 5.
Adaption to local decimal separator and adaption of (thousands) grouping separator is to be done by TemplateStyles:
A second one is configuring multiplication sign and 10n appearance:
Local page names can be provided via cssNum and cssNumExp assignments.