Dplnum: Difference between revisions
Content deleted Content added
imported>FrozenPlum add purgenote |
imported>FrozenPlum lsth transclude the modules back in from example subpages |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{purgenote}} |
|||
{{DPL manual|section=dplnum}} |
{{DPL manual|section=dplnum}} |
||
⚫ | |||
<pre><nowiki> |
|||
{{#dplnum:text}} |
|||
</nowiki></pre> |
|||
⚫ | |||
==Effect== |
|||
Tries to guess a number that is buried in the text. |
|||
⚫ | |||
Uses a set of heuristic rules which may work or not. |
|||
<code><nowiki>{{#dplnum:</nowiki>''text''<nowiki>}}</nowiki></code> where {{tt|text}} is a number within some text. |
|||
==Examples== |
|||
⚫ | |||
⚫ | |||
{{#lsth:Examples/Module: dplnum (example 1)|Example}} |
|||
{{ViewTest|Examples|Module: dplnum (example 1)}} |
|||
'''Result set:''' |
|||
⚫ | |||
{{#lsth:Examples/Module: dplnum (example 1)|Result}} |
|||
<nowiki> {{#dplnum:this is 4711 a text with a number}} </nowiki> returns: {{#dplnum:this is 4711 a text with a number}} |
|||
<nowiki> {{#dplnum:well above 47 Mio. US$}} </nowiki> returns: {{#dplnum:well above 47 Mio US$}} |
|||
<nowiki> {{#dplnum:13 Mrd}} </nowiki> returns: {{#dplnum:13 Mrd}} |
|||
<nowiki> {{#dplnum:it is 47,123 Mio}} </nowiki> returns: {{#dplnum:it is 47,123 Mio}} |
|||
<nowiki> {{#dplnum:it is 47.123,56}} </nowiki> returns: {{#dplnum:it is 47.123}} |
|||
<nowiki> {{#dplnum:it is 47,000}} </nowiki> returns: {{#dplnum:it is 47,000}} |
|||
<nowiki> {{#dplnum:it is 4.13}} </nowiki> returns: {{#dplnum:it is 4.13}} |
|||
<nowiki> {{#dplnum:it is 4,13}} </nowiki> returns: {{#dplnum:it is 4,13}} |
|||
<nowiki> {{#dplnum:it is 0,13}} </nowiki> returns: {{#dplnum:it is 0,13}} |
|||
[[Category:Other Modules]] |
[[Category:Other Modules]] |
Latest revision as of 03:33, 21 April 2023
|
Manual | dplnum |
This module tries to guess a number that is buried in text, using a set of heuristic rules which may work or not. The idea is to extract the number, so it can be used as a sorting value in the column of a DPL table output.
Syntax
{{#dplnum:text}}
where text is a number within some text.
Examples
Example set {{#lsth:Examples/Module: dplnum (example 1)|Example}}
Page Template:ViewTest/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Result set: {{#lsth:Examples/Module: dplnum (example 1)|Result}}