https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3AWert Modul:Wert - Versionsgeschichte 2025-06-04T20:11:59Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.45.0-wmf.3 https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190060341&oldid=prev Sivizius am 2. Juli 2019 um 10:55 Uhr 2019-07-02T10:55:49Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:55 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 107:</td> <td colspan="2" class="diff-lineno">Zeile 107:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg and arg ~= '' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg and arg ~= '' then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub(',',<del style="font-weight: bold; text-decoration: none;"> </del>'\t')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub(',','\t<ins style="font-weight: bold; text-decoration: none;">'):gsub('[.]',''):gsub('\t','.</ins>')</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub('.', '' )</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub('\t', '.' )</div></td> <td colspan="2" class="diff-empty diff-side-added"></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == '(' and arg:sub(-1) == ')' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == '(' and arg:sub(-1) == ')' then</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.parens = true</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.parens = true</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 129:</td> <td colspan="2" class="diff-lineno">Zeile 127:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local value = tonumber(arg)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local value = tonumber(arg)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not value then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not value then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return fail(<del style="font-weight: bold; text-decoration: none;">'#'..old</del>)</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return fail()</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == ',' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == ',' then</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 147:</td> <td colspan="2" class="diff-lineno">Zeile 145:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> isnegative = true</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> isnegative = true</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return fail(<del style="font-weight: bold; text-decoration: none;">prefix</del>)</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return fail()</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.clean = arg</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.clean = arg</div></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190060168&oldid=prev Sivizius am 2. Juli 2019 um 10:49 Uhr 2019-07-02T10:49:57Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:49 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 125:</td> <td colspan="2" class="diff-lineno">Zeile 125:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local isnegative, propersign, prefix</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local isnegative, propersign, prefix</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local minus = '−'</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local minus = '−'</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> local old=arg</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> prefix, arg = arg:match('^(.-)([%d.]+)$')</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> prefix, arg = arg:match('^(.-)([%d.]+)$')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local value = tonumber(arg)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local value = tonumber(arg)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not value then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not value then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return fail(<del style="font-weight: bold; text-decoration: none;">arg</del>)</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return fail(<ins style="font-weight: bold; text-decoration: none;">'#'..old</ins>)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == ',' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == ',' then</div></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190060126&oldid=prev Sivizius am 2. Juli 2019 um 10:48 Uhr 2019-07-02T10:48:45Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:48 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 146:</td> <td colspan="2" class="diff-lineno">Zeile 146:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> isnegative = true</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> isnegative = true</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return fail()</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return fail(<ins style="font-weight: bold; text-decoration: none;">prefix</ins>)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.clean = arg</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.clean = arg</div></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190060104&oldid=prev Sivizius am 2. Juli 2019 um 10:47 Uhr 2019-07-02T10:47:56Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:47 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 128:</td> <td colspan="2" class="diff-lineno">Zeile 128:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local value = tonumber(arg)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local value = tonumber(arg)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not value then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not value then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return fail()</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return fail(<ins style="font-weight: bold; text-decoration: none;">arg</ins>)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == ',' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == ',' then</div></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190059981&oldid=prev Sivizius am 2. Juli 2019 um 10:41 Uhr 2019-07-02T10:41:39Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:41 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 107:</td> <td colspan="2" class="diff-lineno">Zeile 107:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg and arg ~= '' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg and arg ~= '' then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub('<del style="font-weight: bold; text-decoration: none;">.</del>', '')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub('<ins style="font-weight: bold; text-decoration: none;">,</ins>',<ins style="font-weight: bold; text-decoration: none;"> </ins> '<ins style="font-weight: bold; text-decoration: none;">\t</ins>')</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub('.', '' )</div></td> </tr> <tr> <td colspan="2" class="diff-empty diff-side-deleted"></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub('\t', '.' )</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == '(' and arg:sub(-1) == ')' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == '(' and arg:sub(-1) == ')' then</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.parens = true</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.parens = true</div></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190059872&oldid=prev Sivizius am 2. Juli 2019 um 10:37 Uhr 2019-07-02T10:37:35Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:37 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 107:</td> <td colspan="2" class="diff-lineno">Zeile 107:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg and arg ~= '' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg and arg ~= '' then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub('<del style="font-weight: bold; text-decoration: none;">,</del>', '')</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> arg = arg:gsub('<ins style="font-weight: bold; text-decoration: none;">.</ins>', '')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == '(' and arg:sub(-1) == ')' then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == '(' and arg:sub(-1) == ')' then</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.parens = true</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result.parens = true</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 514:</td> <td colspan="2" class="diff-lineno">Zeile 514:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local delimit_groups = require('Modul:Gapnum').groups</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local delimit_groups = require('Modul:Gapnum').groups</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function delimit(sign, numstr, fmt)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function delimit(sign, numstr, fmt)</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- Return sign and numstr (unsigned digits or '<del style="font-weight: bold; text-decoration: none;">,</del>' only) after formatting.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- Return sign and numstr (unsigned digits or '<ins style="font-weight: bold; text-decoration: none;">.</ins>' only) after formatting.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Four-digit integers are not formatted with gaps.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Four-digit integers are not formatted with gaps.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> fmt = (fmt or ''):lower()</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> fmt = (fmt or ''):lower()</div></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190059756&oldid=prev Sivizius am 2. Juli 2019 um 10:32 Uhr 2019-07-02T10:32:35Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:32 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 128:</td> <td colspan="2" class="diff-lineno">Zeile 128:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return fail()</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return fail()</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == '<del style="font-weight: bold; text-decoration: none;">.</del>' then</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> if arg:sub(1, 1) == '<ins style="font-weight: bold; text-decoration: none;">,</ins>' then</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> arg = '0' .. arg</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> arg = '0' .. arg</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 514:</td> <td colspan="2" class="diff-lineno">Zeile 514:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local delimit_groups = require('Modul:Gapnum').groups</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local delimit_groups = require('Modul:Gapnum').groups</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function delimit(sign, numstr, fmt)</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local function delimit(sign, numstr, fmt)</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- Return sign and numstr (unsigned digits or '<del style="font-weight: bold; text-decoration: none;">.</del>' only) after formatting.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- Return sign and numstr (unsigned digits or '<ins style="font-weight: bold; text-decoration: none;">,</ins>' only) after formatting.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Four-digit integers are not formatted with gaps.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- Four-digit integers are not formatted with gaps.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> fmt = (fmt or ''):lower()</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> fmt = (fmt or ''):lower()</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 527:</td> <td colspan="2" class="diff-lineno">Zeile 527:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result = sign .. table.concat(ipart, ',')</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> result = sign .. table.concat(ipart, ',')</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if dpart then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if dpart then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> result = result .. '<del style="font-weight: bold; text-decoration: none;">.</del>' .. table.concat(dpart)</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> result = result .. '<ins style="font-weight: bold; text-decoration: none;">,</ins>' .. table.concat(dpart)</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 537:</td> <td colspan="2" class="diff-lineno">Zeile 537:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if dpart then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if dpart then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> table.insert(groups, '<del style="font-weight: bold; text-decoration: none;">.</del>' .. (table.remove(dpart, 1) or ''))</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> table.insert(groups, '<ins style="font-weight: bold; text-decoration: none;">,</ins>' .. (table.remove(dpart, 1) or ''))</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> for _, v in ipairs(dpart) do</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> for _, v in ipairs(dpart) do</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> table.insert(groups, '&lt;span style="margin-left:.25em;"&gt;' .. v .. '&lt;/span&gt;')</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> table.insert(groups, '&lt;span style="margin-left:.25em;"&gt;' .. v .. '&lt;/span&gt;')</div></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190059675&oldid=prev Sivizius am 2. Juli 2019 um 10:29 Uhr 2019-07-02T10:29:40Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:29 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 40:</td> <td colspan="2" class="diff-lineno">Zeile 40:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["or"] = " or " ,</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["or"] = " or " ,</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["to"] = " to " ,</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["to"] = " to " ,</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> ["x"] = " <del style="font-weight: bold; text-decoration: none;">×</del> ",</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> ["x"] = " <ins style="font-weight: bold; text-decoration: none;">·</ins> ",</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> ["×"] = " <del style="font-weight: bold; text-decoration: none;">×</del> ",</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> ["×"] = " <ins style="font-weight: bold; text-decoration: none;">·</ins> ",</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["/"] = "/",</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["/"] = "/",</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>}</div></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 47:</td> <td colspan="2" class="diff-lineno">Zeile 47:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- WP:UNIT wants unit repeated when a "multiply" range is used.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- WP:UNIT wants unit repeated when a "multiply" range is used.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["x"] = true,</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ["x"] = true,</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> ["<del style="font-weight: bold; text-decoration: none;">×</del>"] = true,</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> ["<ins style="font-weight: bold; text-decoration: none;">·</ins>"] = true,</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>}</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>}</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td colspan="2" class="diff-lineno">Zeile 704:</td> <td colspan="2" class="diff-lineno">Zeile 704:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> e_text = '10&lt;sup&gt;' .. delimit(e_10.sign, e_10.clean, fmt) .. '&lt;/sup&gt;'</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> e_text = '10&lt;sup&gt;' .. delimit(e_10.sign, e_10.clean, fmt) .. '&lt;/sup&gt;'</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if number.clean then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if number.clean then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> e_text = '&lt;span style="margin-left:0.25em;margin-right:0.15em;"&gt;<del style="font-weight: bold; text-decoration: none;">×</del>&lt;/span&gt;' .. e_text</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> e_text = '&lt;span style="margin-left:0.25em;margin-right:0.15em;"&gt;<ins style="font-weight: bold; text-decoration: none;">·</ins>&lt;/span&gt;' .. e_text</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190059614&oldid=prev Sivizius am 2. Juli 2019 um 10:26 Uhr 2019-07-02T10:26:50Z <p></p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="de"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 2. Juli 2019, 12:26 Uhr</td> </tr><tr> <td colspan="2" class="diff-lineno">Zeile 2:</td> <td colspan="2" class="diff-lineno">Zeile 2:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>-- Format options include scientific and uncertainty notations.</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>-- Format options include scientific and uncertainty notations.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>local data_module = 'Modul:Wert/<del style="font-weight: bold; text-decoration: none;">units</del>'</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>local data_module = 'Modul:Wert/<ins style="font-weight: bold; text-decoration: none;">Einheiten</ins>'</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local convert_module = 'Modul:Convert'</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>local convert_module = 'Modul:Convert'</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td> </tr> </table> Sivizius https://de.wikipedia.org/w/index.php?title=Modul:Wert&diff=190059189&oldid=prev Sivizius: AZ: Die Seite wurde neu angelegt: -- For Vorlage:Wert, output a number and optional unit. -- Format options include scientific and uncer… 2019-07-02T10:06:55Z <p><a href="/wiki/Hilfe:Zusammenfassung_und_Quellen#Auto-Zusammenfassung" title="Hilfe:Zusammenfassung und Quellen">AZ</a>: Die Seite wurde neu angelegt: -- For Vorlage:Wert, output a number and optional unit. -- Format options include scientific and uncer…</p> <p><b>Neue Seite</b></p><div>-- For Vorlage:Wert, output a number and optional unit.<br /> -- Format options include scientific and uncertainty notations.<br /> <br /> local data_module = &#039;Modul:Wert/units&#039;<br /> local convert_module = &#039;Modul:Convert&#039;<br /> <br /> local function valerror(msg, nocat, iswarning)<br /> -- Return formatted message text for an error or warning.<br /> -- Can append &quot;#FormattingError&quot; to URL of a page with a problem to find it.<br /> local anchor = &#039;&lt;span id=&quot;FormattingError&quot;&gt;&lt;/span&gt;&#039;<br /> local body, category<br /> if nocat or mw.title.getCurrentTitle():inNamespaces(1, 2, 3, 5) then<br /> -- No category in Talk, User, User_talk, or Wikipedia_talk.<br /> category = &#039;&#039;<br /> else<br /> category = &#039;[[Category:Pages with incorrect formatting templates use]]&#039;<br /> end<br /> iswarning = false -- problems are infrequent so try showing large error so editor will notice<br /> if iswarning then<br /> body = &#039;&lt;sup class=&quot;noprint Inline-Template&quot; style=&quot;white-space:nowrap;&quot;&gt;&#039; ..<br /> &#039;[[Vorlage:Wert|&lt;span title=&quot;&#039; ..<br /> msg:gsub(&#039;&quot;&#039;, &#039;&amp;quot;&#039;) ..<br /> &#039;&quot;&gt;warning&lt;/span&gt;]]&lt;/sup&gt;&#039;<br /> else<br /> body = &#039;&lt;strong class=&quot;error&quot;&gt;&#039; ..<br /> &#039;Error in &amp;#123;&amp;#123;[[Vorlage:Wert|Wert]]&amp;#125;&amp;#125;: &#039; ..<br /> msg ..<br /> &#039;&lt;/strong&gt;&#039;<br /> end<br /> return anchor .. body .. category<br /> end<br /> <br /> local range_types = {<br /> -- No need for &#039;&amp;nbsp;&#039; because nowrap applies to all output.<br /> [&quot;,&quot;] = &quot;, &quot;,<br /> [&quot;by&quot;] = &quot; by &quot;,<br /> [&quot;-&quot;] = &quot;–&quot;,<br /> [&quot;–&quot;] = &quot;–&quot;,<br /> [&quot;and&quot;] = &quot; and &quot;,<br /> [&quot;or&quot;] = &quot; or &quot; ,<br /> [&quot;to&quot;] = &quot; to &quot; ,<br /> [&quot;x&quot;] = &quot; × &quot;,<br /> [&quot;×&quot;] = &quot; × &quot;,<br /> [&quot;/&quot;] = &quot;/&quot;,<br /> }<br /> local range_repeat_unit = {<br /> -- WP:UNIT wants unit repeated when a &quot;multiply&quot; range is used.<br /> [&quot;x&quot;] = true,<br /> [&quot;×&quot;] = true,<br /> }<br /> <br /> local function extract_item(index, numbers, arg)<br /> -- Extract an item from arg and store the result in numbers[index].<br /> -- If no argument or if argument is valid, return nil (no error);<br /> -- otherwise, return an error message.<br /> -- The stored result is:<br /> -- * a table for a number (empty if there was no specified number); or<br /> -- * a string for range text<br /> -- Input like 1e3 is regarded as invalid for all except argument 1<br /> -- which accepts e notation as an alternative to the &#039;e&#039; argument.<br /> -- Input commas are removed so 1,234 is the same as 1234.<br /> local which = index<br /> local function fail(msg)<br /> local description<br /> if which == &#039;e&#039; then<br /> description = &#039;exponent parameter (&lt;b&gt;e&lt;/b&gt;)&#039;<br /> else<br /> description = &#039;parameter &#039; .. which<br /> end<br /> return description .. &#039; &#039; .. (msg or &#039;is not a valid number&#039;) .. &#039;.&#039;<br /> end<br /> local result = {}<br /> local range = range_types[arg]<br /> if range then<br /> if type(index) == &#039;number&#039; and (index % 2 == 0) then<br /> if index == 2 then<br /> if numbers[1] and numbers[1].exp then<br /> return fail(&#039;cannot use a range if the first parameter includes &quot;e&quot;&#039;)<br /> end<br /> numbers.has_ranges = true<br /> else<br /> if not numbers.has_ranges then<br /> return fail(&#039;needs a range in parameter 2&#039;)<br /> end<br /> end<br /> numbers[index] = range<br /> if range_repeat_unit[arg] then<br /> -- Any &quot;repeat&quot; range forces unit (if any) to be repeated for all items.<br /> numbers.isrepeat = true<br /> end<br /> return nil<br /> end<br /> return fail(&#039;does not accept a range&#039;)<br /> end<br /> if numbers.has_ranges and type(index) == &#039;number&#039; and (index % 2 == 0) then<br /> return fail(&#039;should be a range&#039;)<br /> end<br /> if index == &#039;e&#039; then<br /> local e = numbers[1] and numbers[1].exp<br /> if e then<br /> if arg then<br /> return fail(&#039;cannot be used if the first parameter includes &quot;e&quot;&#039;)<br /> end<br /> arg = e<br /> which = 1<br /> end<br /> end<br /> if arg and arg ~= &#039;&#039; then<br /> arg = arg:gsub(&#039;,&#039;, &#039;&#039;)<br /> if arg:sub(1, 1) == &#039;(&#039; and arg:sub(-1) == &#039;)&#039; then<br /> result.parens = true<br /> arg = arg:sub(2, -2)<br /> end<br /> local a, b = arg:match(&#039;^(.+)[Ee](.+)$&#039;)<br /> if a then<br /> if index == 1 then<br /> arg = a<br /> result.exp = b<br /> else<br /> return fail(&#039;cannot use e notation&#039;)<br /> end<br /> end<br /> local isnegative, propersign, prefix<br /> local minus = &#039;−&#039;<br /> prefix, arg = arg:match(&#039;^(.-)([%d.]+)$&#039;)<br /> local value = tonumber(arg)<br /> if not value then<br /> return fail()<br /> end<br /> if arg:sub(1, 1) == &#039;.&#039; then<br /> arg = &#039;0&#039; .. arg<br /> end<br /> if prefix == &#039;&#039; then<br /> -- Ignore.<br /> elseif prefix == &#039;±&#039; then<br /> -- Display for first number, ignore for others.<br /> if index == 1 then<br /> propersign = &#039;±&#039;<br /> end<br /> elseif prefix == &#039;+&#039; then<br /> propersign = &#039;+&#039;<br /> elseif prefix == &#039;-&#039; or prefix == minus then<br /> propersign = minus<br /> isnegative = true<br /> else<br /> return fail()<br /> end<br /> result.clean = arg<br /> result.sign = propersign or &#039;&#039;<br /> result.value = isnegative and -value or value<br /> end<br /> numbers[index] = result<br /> return nil -- no error<br /> end<br /> <br /> local function get_args(numbers, args)<br /> -- Extract arguments and store the results in numbers.<br /> -- Return nothing (no error) if ok; otherwise, return an error message.<br /> for index = 1, 99 do<br /> local which = index<br /> local arg = args[which] -- has been trimmed<br /> if not arg then<br /> which = &#039;e&#039;<br /> arg = args[which]<br /> end<br /> local msg = extract_item(which, numbers, arg)<br /> if msg then<br /> return msg<br /> end<br /> if which == &#039;e&#039; then<br /> break<br /> end<br /> if index &gt; 19 then<br /> return &#039;too many parameters&#039;<br /> end<br /> end<br /> if numbers.has_ranges and (#numbers % 2 == 0) then<br /> return &#039;need a number after the last parameter because it is a range.&#039;<br /> end<br /> end<br /> <br /> local function get_scale(text, ucode)<br /> -- Return the value of text as a number, or throw an error.<br /> -- This supports extremely basic expressions of the form:<br /> -- a / b<br /> -- a ^ b<br /> -- where a and b are numbers or &#039;pi&#039;.<br /> local n = tonumber(text)<br /> if n then<br /> return n<br /> end<br /> n = text:gsub(&#039;pi&#039;, math.pi)<br /> for _, op in ipairs({ &#039;/&#039;, &#039;^&#039; }) do<br /> local a, b = n:match(&#039;^(.-)&#039; .. op .. &#039;(.*)$&#039;)<br /> if a then<br /> a = tonumber(a)<br /> b = tonumber(b)<br /> if a and b then<br /> if op == &#039;/&#039; then<br /> return a / b<br /> elseif op == &#039;^&#039; then<br /> return a ^ b<br /> end<br /> end<br /> break<br /> end<br /> end<br /> error(&#039;Unit &quot;&#039; .. ucode .. &#039;&quot; has invalid scale &quot;&#039; .. text .. &#039;&quot;&#039;)<br /> end<br /> <br /> local function get_builtin_unit(ucode, definitions)<br /> -- Return table of information for the specified built-in unit, or nil if not known.<br /> -- Each defined unit code must be followed by two spaces (not tab characters).<br /> local _, pos = definitions:find(&#039;\n&#039; .. ucode .. &#039; &#039;, 1, true)<br /> if pos then<br /> local endline = definitions:find(&#039;%s*\n&#039;, pos)<br /> if endline then<br /> local result = {}<br /> local n = 0<br /> local text = definitions:sub(pos + 1, endline - 1):gsub(&#039;%s%s+&#039;, &#039;\t&#039;)<br /> for item in (text .. &#039;\t&#039;):gmatch(&#039;(%S.-)\t&#039;) do<br /> if item == &#039;ALIAS&#039; then<br /> result.alias = true<br /> elseif item == &#039;ANGLE&#039; then<br /> result.isangle = true<br /> result.nospace = true<br /> elseif item == &#039;NOSPACE&#039; then<br /> result.nospace = true<br /> elseif item == &#039;SI&#039; then<br /> result.si = true<br /> else<br /> n = n + 1<br /> if n == 1 then<br /> local link, symbol = item:match(&#039;^%[%[([^|]+)|(.+)%]%]$&#039;)<br /> if link then<br /> result.symbol = symbol<br /> result.link = link<br /> n = 2<br /> else<br /> result.symbol = item<br /> end<br /> elseif n == 2 then<br /> result.link = item<br /> elseif n == 3 then<br /> result.scale_text = item<br /> result.scale = get_scale(item, ucode)<br /> else<br /> result.more_ignored = item<br /> break<br /> end<br /> end<br /> end<br /> if result.si then<br /> local s = result.symbol<br /> if ucode == &#039;mc&#039; .. s or ucode == &#039;mu&#039; .. s then<br /> result.ucode = &#039;µ&#039; .. s -- unit code for convert should be this<br /> end<br /> end<br /> if n &gt;= 2 or (n &gt;= 1 and result.alias) then<br /> return result<br /> end<br /> -- Ignore invalid definition, treating it as a comment.<br /> end<br /> end<br /> end<br /> <br /> local function convert_lookup(ucode, value, scaled_top, want_link, si, options)<br /> local lookup = require(convert_module)._unit<br /> return lookup(ucode, {<br /> value = value,<br /> scaled_top = scaled_top,<br /> link = want_link,<br /> si = si,<br /> sort = options.sortable,<br /> })<br /> end<br /> <br /> local function get_unit(ucode, value, scaled_top, options)<br /> local want_link = options.want_link<br /> if scaled_top then<br /> want_link = options.want_per_link<br /> end<br /> local data = mw.loadData(data_module)<br /> local result = options.want_longscale and<br /> get_builtin_unit(ucode, data.builtin_units_long_scale) or<br /> get_builtin_unit(ucode, data.builtin_units)<br /> local si, use_convert<br /> if result then<br /> if result.alias then<br /> ucode = result.symbol<br /> use_convert = true<br /> end<br /> if result.scale then<br /> -- Setting si means convert will use the unit as given, and the sort key<br /> -- will be calculated from the value without any extra scaling that may<br /> -- occur if convert found the unit code. For example, if val defines the<br /> -- unit &#039;year&#039; with a scale and if si were not set, convert would also apply<br /> -- its own scale because convert knows that a year is 31,557,600 seconds.<br /> si = { result.symbol, result.link }<br /> value = value * result.scale<br /> end<br /> if result.si then<br /> ucode = result.ucode or ucode<br /> si = { result.symbol, result.link }<br /> use_convert = true<br /> end<br /> else<br /> result = {}<br /> use_convert = true<br /> end<br /> local convert_unit = convert_lookup(ucode, value, scaled_top, want_link, si, options)<br /> result.sortkey = convert_unit.sortspan<br /> if use_convert then<br /> result.text = convert_unit.text<br /> result.scaled_top = convert_unit.scaled_value<br /> else<br /> if want_link then<br /> result.text = &#039;[[&#039; .. result.link .. &#039;|&#039; .. result.symbol .. &#039;]]&#039;<br /> else<br /> result.text = result.symbol<br /> end<br /> result.scaled_top = value<br /> end<br /> return result<br /> end<br /> <br /> local function makeunit(value, options)<br /> -- Return table of information for the requested unit and options, or<br /> -- return nil if no unit.<br /> options = options or {}<br /> local unit<br /> local ucode = options.u<br /> local percode = options.per<br /> if ucode then<br /> unit = get_unit(ucode, value, nil, options)<br /> elseif percode then<br /> unit = { nospace = true, scaled_top = value }<br /> else<br /> return nil<br /> end<br /> local text = unit.text or &#039;&#039;<br /> local sortkey = unit.sortkey<br /> if percode then<br /> local function bracketed(code, text)<br /> return code:find(&#039;[*./]&#039;) and &#039;(&#039; .. text .. &#039;)&#039; or text<br /> end<br /> local perunit = get_unit(percode, 1, unit.scaled_top, options)<br /> text = (ucode and bracketed(ucode, text) or &#039;&#039;) ..<br /> &#039;/&#039; .. bracketed(percode, perunit.text)<br /> sortkey = perunit.sortkey<br /> end<br /> if not (unit.nospace or options.nospace) then<br /> text = &#039;&amp;nbsp;&#039; .. text<br /> end<br /> return { text = text, isangle = unit.isangle, sortkey = sortkey }<br /> end<br /> <br /> local function list_units(mode)<br /> -- Return wikitext to list the built-in units.<br /> -- A unit code should not contain wikimarkup so don&#039;t bother escaping.<br /> local data = mw.loadData(data_module)<br /> local definitions = data.builtin_units .. data.builtin_units_long_scale<br /> local last_was_blank = true<br /> local n = 0<br /> local result = {}<br /> local function add(line)<br /> if line == &#039;&#039; then<br /> last_was_blank = true<br /> else<br /> if last_was_blank and n &gt; 0 then<br /> n = n + 1<br /> result[n] = &#039;&#039;<br /> end<br /> last_was_blank = false<br /> n = n + 1<br /> result[n] = line<br /> end<br /> end<br /> local si_prefixes = {<br /> -- These are the prefixes recognized by convert; u is accepted for micro.<br /> y = &#039;y&#039;,<br /> z = &#039;z&#039;,<br /> a = &#039;a&#039;,<br /> f = &#039;f&#039;,<br /> p = &#039;p&#039;,<br /> n = &#039;n&#039;,<br /> u = &#039;µ&#039;,<br /> [&#039;µ&#039;] = &#039;µ&#039;,<br /> m = &#039;m&#039;,<br /> c = &#039;c&#039;,<br /> d = &#039;d&#039;,<br /> da = &#039;da&#039;,<br /> h = &#039;h&#039;,<br /> k = &#039;k&#039;,<br /> M = &#039;M&#039;,<br /> G = &#039;G&#039;,<br /> T = &#039;T&#039;,<br /> P = &#039;P&#039;,<br /> E = &#039;E&#039;,<br /> Z = &#039;Z&#039;,<br /> Y = &#039;Y&#039;,<br /> }<br /> local function is_valid(ucode, unit)<br /> if unit and not unit.more_ignored then<br /> assert(type(unit.symbol) == &#039;string&#039; and unit.symbol ~= &#039;&#039;)<br /> if unit.alias then<br /> if unit.link or unit.scale_text or unit.si then<br /> return false<br /> end<br /> end<br /> if unit.si then<br /> if unit.scale_text then<br /> return false<br /> end<br /> ucode = unit.ucode or ucode<br /> local base = unit.symbol<br /> if ucode == base then<br /> unit.display = base<br /> return true<br /> end<br /> local plen = #ucode - #base<br /> if plen &gt; 0 then<br /> local prefix = si_prefixes[ucode:sub(1, plen)]<br /> if prefix and ucode:sub(plen + 1) == base then<br /> unit.display = prefix .. base<br /> return true<br /> end<br /> end<br /> else<br /> unit.display = unit.symbol<br /> return true<br /> end<br /> end<br /> return false<br /> end<br /> local lookup = require(convert_module)._unit<br /> local function show_convert(ucode, unit)<br /> -- If a built-in unit defines a scale or sets the SI flag, any unit defined in<br /> -- convert is not used (the scale or SI prefix&#039;s scale is used for a sort key).<br /> -- If there is no scale or SI flag, and the unit is not defined in convert,<br /> -- the sort key may not be correct; this allows such units to be identified.<br /> if not (unit.si or unit.scale_text) then<br /> if mode == &#039;convert&#039; then<br /> unit.show = not lookup(unit.alias and unit.symbol or ucode).unknown<br /> unit.show_text = &#039;CONVERT&#039;<br /> elseif mode == &#039;unknown&#039; then<br /> unit.show = lookup(unit.alias and unit.symbol or ucode).unknown<br /> unit.show_text = &#039;UNKNOWN&#039;<br /> elseif not unit.alias then<br /> -- Show convert&#039;s scale in square brackets (&#039;[1]&#039; for an unknown unit).<br /> -- Don&#039;t show scale for an alias because it&#039;s misleading for temperature<br /> -- and an alias is probably not useful for anything else.<br /> local scale = lookup(ucode, {value=1, sort=&#039;on&#039;}).scaled_value<br /> if type(scale) == &#039;number&#039; then<br /> scale = string.format(&#039;%.5g&#039;, scale):gsub(&#039;e%+?(%-?)0*(%d+)&#039;, &#039;e%1%2&#039;)<br /> else<br /> scale = &#039;?&#039;<br /> end<br /> unit.show = true<br /> unit.show_text = &#039;[&#039; .. scale .. &#039;]&#039;<br /> end<br /> end<br /> end<br /> for line in definitions:gmatch(&#039;([^\n]*)\n&#039;) do<br /> local pos, _ = line:find(&#039; &#039;, 1, true)<br /> if pos then<br /> local ucode = line:sub(1, pos - 1)<br /> local unit = get_builtin_unit(ucode, &#039;\n&#039; .. line .. &#039;\n&#039;)<br /> if is_valid(ucode, unit) then<br /> show_convert(ucode, unit)<br /> local flags, text<br /> if unit.alias then<br /> text = unit.symbol<br /> else<br /> text = &#039;[[&#039; .. unit.link .. &#039;|&#039; .. unit.display .. &#039;]]&#039;<br /> end<br /> if unit.isangle then<br /> unit.nospace = nil -- don&#039;t show redundant flag<br /> end<br /> for _, f in ipairs({<br /> { &#039;alias&#039;, &#039;ALIAS&#039; },<br /> { &#039;isangle&#039;, &#039;ANGLE&#039; },<br /> { &#039;nospace&#039;, &#039;NOSPACE&#039; },<br /> { &#039;si&#039;, &#039;SI&#039; },<br /> { &#039;scale_text&#039;, unit.scale_text },<br /> { &#039;show&#039;, unit.show_text },<br /> }) do<br /> if unit[f[1]] then<br /> local t = f[2]<br /> if t:match(&#039;^%u+$&#039;) then<br /> t = &#039;&lt;small&gt;&#039; .. t .. &#039;&lt;/small&gt;&#039;<br /> end<br /> if flags then<br /> flags = flags .. &#039; &#039; .. t<br /> else<br /> flags = t<br /> end<br /> end<br /> end<br /> if flags then<br /> text = text .. &#039; • &#039; .. flags<br /> end<br /> add(ucode .. &#039; = &#039; .. text .. &#039;&lt;br /&gt;&#039;)<br /> else<br /> add(line .. &#039; ◆ &lt;b&gt;invalid definition&lt;/b&gt;&lt;br /&gt;&#039;)<br /> end<br /> else<br /> add(line)<br /> end<br /> end<br /> return table.concat(result, &#039;\n&#039;)<br /> end<br /> <br /> local delimit_groups = require(&#039;Modul:Gapnum&#039;).groups<br /> local function delimit(sign, numstr, fmt)<br /> -- Return sign and numstr (unsigned digits or &#039;.&#039; only) after formatting.<br /> -- Four-digit integers are not formatted with gaps.<br /> fmt = (fmt or &#039;&#039;):lower()<br /> if fmt == &#039;none&#039; or (fmt == &#039;&#039; and #numstr == 4 and numstr:match(&#039;^%d+$&#039;)) then<br /> return sign .. numstr<br /> end<br /> -- Group number by integer and decimal parts.<br /> -- If there is no decimal part, delimit_groups returns only one table.<br /> local ipart, dpart = delimit_groups(numstr)<br /> local result<br /> if fmt == &#039;commas&#039; then<br /> result = sign .. table.concat(ipart, &#039;,&#039;)<br /> if dpart then<br /> result = result .. &#039;.&#039; .. table.concat(dpart)<br /> end<br /> else<br /> -- Delimit with a small gap by default.<br /> local groups = {}<br /> groups[1] = table.remove(ipart, 1)<br /> for _, v in ipairs(ipart) do<br /> table.insert(groups, &#039;&lt;span style=&quot;margin-left:.25em;&quot;&gt;&#039; .. v .. &#039;&lt;/span&gt;&#039;)<br /> end<br /> if dpart then<br /> table.insert(groups, &#039;.&#039; .. (table.remove(dpart, 1) or &#039;&#039;))<br /> for _, v in ipairs(dpart) do<br /> table.insert(groups, &#039;&lt;span style=&quot;margin-left:.25em;&quot;&gt;&#039; .. v .. &#039;&lt;/span&gt;&#039;)<br /> end<br /> end<br /> result = sign .. table.concat(groups)<br /> end<br /> return result<br /> end<br /> <br /> local function sup_sub(sup, sub, align)<br /> -- Return the same result as Modul:Su except Wert defaults to align=right.<br /> if align == &#039;l&#039; or align == &#039;left&#039; then<br /> align = &#039;left&#039;<br /> elseif align == &#039;c&#039; or align == &#039;center&#039; then<br /> align = &#039;center&#039;<br /> else<br /> align = &#039;right&#039;<br /> end<br /> return &#039;&lt;span style=&quot;display:inline-block;margin-bottom:-0.3em;vertical-align:-0.4em;line-height:1.2em;font-size:85%;text-align:&#039; ..<br /> align .. &#039;;&quot;&gt;&#039; .. sup .. &#039;&lt;br /&gt;&#039; .. sub .. &#039;&lt;/span&gt;&#039;<br /> end<br /> <br /> local function range_text(items, unit_table, options)<br /> local fmt = options.fmt<br /> local nend = items.nend or &#039;&#039;<br /> if items.isrepeat or unit_table.isangle then<br /> nend = nend .. unit_table.text<br /> end<br /> local text = &#039;&#039;<br /> for i = 1, #items do<br /> if i % 2 == 0 then<br /> text = text .. items[i]<br /> else<br /> text = text .. delimit(items[i].sign, items[i].clean, fmt) .. nend<br /> end<br /> end<br /> return text<br /> end<br /> <br /> local function uncertainty_text(uncertainty, unit_table, options)<br /> local angle, text, need_parens<br /> if unit_table.isangle then<br /> angle = unit_table.text<br /> end<br /> local upper = uncertainty.upper or {}<br /> local lower = uncertainty.lower or {}<br /> local uncU = upper.clean<br /> if uncU then<br /> local fmt = options.fmt<br /> local uncL = lower.clean<br /> if uncL then<br /> uncU = delimit(&#039;+&#039;, uncU, fmt) .. (upper.errend or &#039;&#039;)<br /> uncL = delimit(&#039;−&#039;, uncL, fmt) .. (lower.errend or &#039;&#039;)<br /> if angle then<br /> uncU = uncU .. angle<br /> uncL = uncL .. angle<br /> end<br /> text = (angle or &#039;&#039;) ..<br /> &#039;&lt;span style=&quot;margin-left:0.3em;&quot;&gt;&#039; ..<br /> sup_sub(uncU, uncL, options.align) ..<br /> &#039;&lt;/span&gt;&#039;<br /> else<br /> if upper.parens then<br /> text = &#039;(&#039; .. uncU .. &#039;)&#039; -- old template did not delimit<br /> else<br /> text = (angle or &#039;&#039;) ..<br /> &#039;&lt;span style=&quot;margin-left:0.3em;margin-right:0.15em;&quot;&gt;±&lt;/span&gt;&#039; ..<br /> delimit(&#039;&#039;, uncU, fmt)<br /> need_parens = true<br /> end<br /> if uncertainty.errend then<br /> text = text .. uncertainty.errend<br /> end<br /> if angle then<br /> text = text .. angle<br /> end<br /> end<br /> else<br /> if angle then<br /> text = angle<br /> end<br /> end<br /> return text, need_parens<br /> end<br /> <br /> local function _main(values, unit_spec, options)<br /> if options.sandbox then<br /> data_module = data_module .. &#039;/sandbox&#039;<br /> convert_module = convert_module .. &#039;/sandbox&#039;<br /> end<br /> local action = options.action<br /> if action then<br /> if action == &#039;list&#039; then<br /> -- Kludge: am using the align parameter (a=xxx) for type of list.<br /> return list_units(options.align)<br /> end<br /> return valerror(&#039;invalid action &quot;&#039; .. action .. &#039;&quot;.&#039;, options.nocat)<br /> end<br /> local number = values.number or (values.numbers and values.numbers[1]) or {}<br /> local e_10 = options.e or {}<br /> local novalue = (number.value == nil and e_10.clean == nil)<br /> local fmt = options.fmt<br /> local want_sort = true<br /> local sortable = options.sortable<br /> if sortable == &#039;off&#039; or (sortable == nil and novalue) then<br /> want_sort = false<br /> elseif sortable == &#039;debug&#039; then<br /> -- Same as sortable = &#039;on&#039; but the sort key is displayed.<br /> else<br /> sortable = &#039;on&#039;<br /> end<br /> local sort_value = 1<br /> if want_sort then<br /> sort_value = number.value or 1<br /> if e_10.value and sort_value ~= 0 then<br /> -- The &#039;if&#039; avoids {{val|0|e=1234}} giving an invalid sort_value due to overflow.<br /> sort_value = sort_value * 10^e_10.value<br /> end<br /> end<br /> local unit_table = makeunit(sort_value, {<br /> u = unit_spec.u,<br /> want_link = unit_spec.want_link,<br /> per = unit_spec.per,<br /> want_per_link = unit_spec.want_per_link,<br /> nospace = novalue,<br /> want_longscale = unit_spec.want_longscale,<br /> sortable = sortable,<br /> })<br /> local sortkey<br /> if unit_table then<br /> if want_sort then<br /> sortkey = unit_table.sortkey<br /> end<br /> else<br /> unit_table = { text = &#039;&#039; }<br /> if want_sort then<br /> sortkey = convert_lookup(&#039;dummy&#039;, sort_value, nil, nil, nil, { sortable = sortable }).sortspan<br /> end<br /> end<br /> local final_unit = unit_table.isangle and &#039;&#039; or unit_table.text<br /> local e_text, n_text, need_parens<br /> local uncertainty = values.uncertainty<br /> if uncertainty then<br /> if number.clean then<br /> n_text = delimit(number.sign, number.clean, fmt) .. (number.nend or &#039;&#039;)<br /> local text<br /> text, need_parens = uncertainty_text(uncertainty, unit_table, options)<br /> if text then<br /> n_text = n_text .. text<br /> end<br /> else<br /> n_text = &#039;&#039;<br /> end<br /> else<br /> if values.numbers.isrepeat then<br /> final_unit = &#039;&#039;<br /> end<br /> n_text = range_text(values.numbers, unit_table, options)<br /> need_parens = true<br /> end<br /> if e_10.clean then<br /> if need_parens then<br /> n_text = &#039;(&#039; .. n_text .. &#039;)&#039;<br /> end<br /> e_text = &#039;10&lt;sup&gt;&#039; .. delimit(e_10.sign, e_10.clean, fmt) .. &#039;&lt;/sup&gt;&#039;<br /> if number.clean then<br /> e_text = &#039;&lt;span style=&quot;margin-left:0.25em;margin-right:0.15em;&quot;&gt;×&lt;/span&gt;&#039; .. e_text<br /> end<br /> else<br /> e_text = &#039;&#039;<br /> end<br /> local result =<br /> (sortkey or &#039;&#039;) ..<br /> (options.prefix or &#039;&#039;) ..<br /> n_text ..<br /> e_text ..<br /> final_unit ..<br /> (options.suffix or &#039;&#039;)<br /> if result ~= &#039;&#039; then<br /> result = &#039;&lt;span class=&quot;nowrap&quot;&gt;&#039; .. result .. &#039;&lt;/span&gt;&#039;<br /> end<br /> return result .. (options.warning or &#039;&#039;)<br /> end<br /> <br /> local function check_parameters(args, has_ranges, nocat)<br /> -- Return warning text for the first problem parameter found, or nothing if ok.<br /> local whitelist = {<br /> a = true,<br /> action = true,<br /> debug = true,<br /> e = true,<br /> [&#039;end&#039;] = true,<br /> errend = true,<br /> [&#039;+errend&#039;] = true,<br /> [&#039;-errend&#039;] = true,<br /> fmt = true,<br /> [&#039;long scale&#039;] = true,<br /> long_scale = true,<br /> longscale = true,<br /> nocategory = true,<br /> p = true,<br /> s = true,<br /> sortable = true,<br /> u = true,<br /> ul = true,<br /> up = true,<br /> upl = true,<br /> }<br /> for k, v in pairs(args) do<br /> if type(k) == &#039;string&#039; and not whitelist[k] then<br /> local warning = &#039;Val parameter &quot;&#039; .. k .. &#039;=&#039; .. v .. &#039;&quot; is not supported&#039;<br /> return valerror(warning, nocat, true)<br /> end<br /> end<br /> if not has_ranges and args[4] then<br /> return valerror(&#039;Val parameter 4 ignored&#039;, nocat, true)<br /> end<br /> end<br /> <br /> local function main(frame)<br /> local getArgs = require(&#039;Modul:Arguments&#039;).getArgs<br /> local args = getArgs(frame, {wrappers = { &#039;Vorlage:Wert&#039; }})<br /> local nocat = args.nocategory<br /> local numbers = {} -- table of number tables, perhaps with range text<br /> local msg = get_args(numbers, args)<br /> if msg then<br /> return valerror(msg, nocat)<br /> end<br /> if args.u and args.ul then<br /> return valerror(&#039;unit (&lt;b&gt;u&lt;/b&gt;) and unit with link (&lt;b&gt;ul&lt;/b&gt;) are both specified, only one is allowed.&#039;, nocat)<br /> end<br /> if args.up and args.upl then<br /> return valerror(&#039;unit per (&lt;b&gt;up&lt;/b&gt;) and unit per with link (&lt;b&gt;upl&lt;/b&gt;) are both specified, only one is allowed.&#039;, nocat)<br /> end<br /> local values<br /> if numbers.has_ranges then<br /> -- Multiple values with range separators but no uncertainty.<br /> numbers.nend = args[&#039;end&#039;]<br /> values = {<br /> numbers = numbers,<br /> }<br /> else<br /> -- A single value with optional uncertainty.<br /> local function setfield(i, dst, src)<br /> local v = args[src]<br /> if v then<br /> if numbers[i] then<br /> numbers[i][dst] = v<br /> else<br /> numbers[i] = { [dst] = v }<br /> end<br /> end<br /> end<br /> setfield(1, &#039;nend&#039;, &#039;end&#039;)<br /> setfield(2, &#039;errend&#039;, &#039;+errend&#039;)<br /> setfield(3, &#039;errend&#039;, &#039;-errend&#039;)<br /> values = {<br /> number = numbers[1],<br /> uncertainty = {<br /> upper = numbers[2],<br /> lower = numbers[3],<br /> errend = args.errend,<br /> }<br /> }<br /> end<br /> local unit_spec = {<br /> u = args.ul or args.u,<br /> want_link = args.ul ~= nil,<br /> per = args.upl or args.up,<br /> want_per_link = args.upl ~= nil,<br /> want_longscale = (args.longscale or args.long_scale or args[&#039;long scale&#039;]) == &#039;on&#039;,<br /> }<br /> local options = {<br /> action = args.action,<br /> align = args.a,<br /> e = numbers.e,<br /> fmt = args.fmt,<br /> nocat = nocat,<br /> prefix = args.p,<br /> sandbox = string.find(frame:getTitle(), &#039;sandbox&#039;, 1, true) ~= nil,<br /> sortable = args.sortable or (args.debug == &#039;yes&#039; and &#039;debug&#039; or nil),<br /> suffix = args.s,<br /> warning = check_parameters(args, numbers.has_ranges, nocat),<br /> }<br /> return _main(values, unit_spec, options)<br /> end<br /> <br /> return { main = main, _main = _main }</div> Sivizius