Vorlage:%
Erscheinungsbild
Prozentsatz aus Prozentwert und Grundwert berechnen. Im Erfolgsfall endet das Ergebis auf
% – ansonsten 0 allein.
<templatestyles src="TOC nonum/styles.css"></templatestyles>
⧼templatedata-doc-params⧽
| ⧼templatedata-doc-param-name⧽ | ⧼templatedata-doc-param-desc⧽ | ⧼templatedata-doc-param-type⧽ | ⧼templatedata-doc-param-status⧽ | |
|---|---|---|---|---|
| Anteil | 1 | Anteil vom Grundwert
| ⧼templatedata-doc-param-type-number⧽ | ⧼templatedata-doc-param-status-required⧽ |
| Grundwert | 2 | Grundwert (Basis, Bezugswert, 100 %) – Null unzulässig
| ⧼templatedata-doc-param-type-number⧽ | ⧼templatedata-doc-param-status-required⧽ |
| Dezimalstellen | 3 | Anzahl der zu rundenden Dezimalstellen
| ⧼templatedata-doc-param-type-number⧽ | ⧼templatedata-doc-param-status-optional⧽ |
| Nullen | 4 | schließende Nullen in den Nachkommastellen beibehalten
| ⧼templatedata-doc-param-type-boolean⧽ | ⧼templatedata-doc-param-status-optional⧽ |
| Zahlenformat (Eingabe) | parse | Zahlenformat der Eingabe
| ⧼templatedata-doc-param-type-line⧽ | ⧼templatedata-doc-param-status-optional⧽ |
| Zahlenformat (Ergebnis) | low | Zahlenformat für das Ergebnis im „Computer-Format“ (Vorgabe: lokales Wiki)
| ⧼templatedata-doc-param-type-boolean⧽ | ⧼templatedata-doc-param-status-optional⧽ |
Zahlenformat (Eingabe)
{{#lst:Modul:Expr/Doku|parseSpec}}
Kopiervorlage
<syntaxhighlight lang="wikitext" copy> 0 </syntaxhighlight>
Beispiele
| Einbindung | Erwartet | Generiert |
|---|---|---|
{{%}}
|
»0« | »0«
|
{{% |15|30}}
|
»50 %« | »50 %«
|
{{% |15|300}}
|
»5 %« | »5 %«
|
{{% |-15|300}}
|
»−5 %« | »−5 %« |
{{% |750|300}}
|
»250 %« | »250 %«
|
{{% |2.5|10}}
|
»25 %« | »25 %«
|
{{% |25|1000}}
|
»3 %« | »3 %«
|
{{% |1|0}}
|
»0« | »0«
|
{{% | 1 | 3 }}
|
»33 %« | »33 %«
|
{{% | 2 | 3 | 0 }}
|
»67 %« | »67 %«
|
{{% | 3 | 3 | 2 | 1}}
|
»100,00 %« | »100,00 %«
|
{{% | 1 | 4 | 2 }}
|
»25 %« | »25 %«
|
{{% | 2 | 4 | 2 | 1 }}
|
»50,00 %« | »50,00 %«
|
{{% | 362553 | 7937734 | 5 }}
|
»4,56746 %« | »4,56746 %«
|
Lua
Verwendetes Modul: Expr #percent