Vorlage:FormatZahl: Unterschied zwischen den Versionen

Die Seite wurde neu angelegt: „<noinclude> </noinclude><includeonly><!-- Ausgabe des Vorzeichens (rekursiv) -->{{#ifexpr:{{{1}}} < 0|-}}<!-- Ab hier nur noch Beträge -->{{#ifexpr:abs({{{…“
 
KKeine Bearbeitungszusammenfassung
 
Zeile 1: Zeile 1:
<noinclude>
<onlyinclude><includeonly><!--
</noinclude><includeonly><!--
-->{{#iferror: {{#expr: 1*{{{1}}} }}
 
  | {{{1}}}
  Ausgabe des Vorzeichens (rekursiv)
| {{#ifexpr: {{{1}}} < -0.004999999 | - }}<!--
 
-->{{#switch: {{uc:{{{LAND}}}}}
-->{{#ifexpr:{{{1}}} < 0|-}}<!--
    | CH
 
    | LI = {{#ifexpr: (abs({{{1}}}) round 0) = 1000000000000
Ab hier nur noch Beträge
            | 1'000'000'000'000
 
            | {{#ifexpr: (abs({{{1}}}) round 0) >= 1000000000 | {{#expr: ((abs({{{1}}}) round 0) / 1000000000) mod 1000}}' }}<!--
-->{{#ifexpr:abs({{{1}}}) > 999999999|{{#expr:(abs({{{1}}}) / 1000000000 - 0.5) round 0}}{{#switch:{{uc:{{{LAND|}}}}}|CH|LI='|#default=.}}}}<!--
          -->{{#ifexpr: (abs({{{1}}}) round 0) >= 100000000 | {{#expr: ((abs({{{1}}}) round 0) / 100000000) mod 10}} }}<!--
-->{{#ifexpr:abs({{{1}}}) > 999999|{{#ifexpr:abs({{{1}}}) > 999999999|{{#ifexpr:(((abs({{{1}}}) / 1000000 - 0.5) round 0) mod 1000) < 100|0}}{{#ifexpr:(((abs({{{1}}}) / 1000000 - 0.5) round 0) mod 1000) < 10|0}}}}{{#expr:((abs({{{1}}}) / 1000000 - 0.5) round 0) mod 1000}}{{#switch:{{uc:{{{LAND|}}}}}|CH|LI='|#default=.}}}}<!--
          -->{{#ifexpr: (abs({{{1}}}) round 0) >= 10000000 | {{#expr: ((abs({{{1}}}) round 0) / 10000000) mod 10}} }}<!--
-->{{#ifexpr:abs({{{1}}}) > 999|{{#ifexpr:abs({{{1}}}) > 999999|{{#ifexpr:(((abs({{{1}}}) / 1000 - 0.5) round 0) mod 1000) < 100|0}}{{#ifexpr:(((abs({{{1}}}) / 1000 - 0.5) round 0) mod 1000) < 10|0}}}}{{#expr:((abs({{{1}}}) / 1000 - 0.5) round 0) mod 1000}}{{#ifexpr:abs({{{1}}})>9999|{{#switch:{{uc:{{{LAND|}}}}}|CH|LI='|#default=.}}}}}}<!--
          -->{{#ifexpr: (abs({{{1}}}) round 0) >= 1000000 | {{#expr: ((abs({{{1}}}) round 0) / 1000000) mod 10}}' }}<!--
 
          -->{{#ifexpr: (abs({{{1}}}) round 0) >= 100000 | {{#expr: ((abs({{{1}}}) round 0) / 100000) mod 10}} }}<!--
Ab hier nur noch der Wert kleiner Tausend ohne weitere Tausendertrennzeichen,
          -->{{#ifexpr: (abs({{{1}}}) round 0) >= 10000 | {{#expr: ((abs({{{1}}}) round 0) / 10000) mod 10}} }}<!--
Rundung erfolgt auf max. 2 Nachkommastellen, so dass für Werte mit Nachkommastellen max. 2 signifikante Stellen auftreten
          -->{{#ifexpr: (abs({{{1}}}) round 0) >= 1000 | {{#expr: ((abs({{{1}}}) round 0) / 1000) mod 10}} }}<!--
 
          -->{{#ifexpr: ({{#ifeq: {{uc:{{{2}}}}} | T | 1 | 0 }} and ((abs({{{1}}}) round 0) >= 1000)) or ((abs({{{1}}}) round 0) >= 10000) | ' }}<!--
-->{{#ifexpr:(abs({{{1}}})) > 999|{{#ifexpr:(abs({{{1}}})-(((abs({{{1}}}) / 1000) mod 1000000000000) * 1000)) < 100|0}}{{#ifexpr:(abs({{{1}}})-(((abs({{{1}}}) / 1000) mod 1000000000000) * 1000)) <  10|0}} }}{{#switch:{{uc:{{{LAND|}}}}}|CH|LI=<!--
          -->{{#ifexpr: (abs({{{1}}}) round 0) >= 100
 
              | {{#expr: ((abs({{{1}}}) round 0) / 100) mod 10}}<!--
Ausgabe für CH und LI mit Punkt:
              -->{{#ifexpr: (abs({{{1}}}) round 0) >= 10 | {{#expr: ((abs({{{1}}}) round 0) / 10) mod 10}} }}<!--
-->{{#expr:(abs({{{1}}})-(((abs({{{1}}}) / 1000) mod 1000000000000) * 1000)) round
              -->{{#expr: (abs({{{1}}}) round 0) mod 10}}
{{#ifexpr:abs({{{1}}}) > 100 |0|
              | {{#ifexpr: abs({{{1}}}) > 10 | {{#expr: abs({{{1}}}) round 1}} | {{#expr: abs({{{1}}}) round 2}} }} }} }}
{{#ifexpr:abs({{{1}}}) > 10 |1|
    | #default = {{#ifexpr: (abs({{{1}}}) round 0) >= 10000
                          2}} }} }}|#default=<!--
                  | {{ZAHLENFORMAT: {{#expr: abs({{{1}}}) round 0}} }}
Ausgabe für DE und AT mit Komma:
                  | {{#ifexpr: (abs({{{1}}}) round 0) >= 1000
-->{{formatnum:
                    | {{#ifeq: {{uc:{{{2}}}}} | T
{{#expr: (abs({{{1}}})-(((abs({{{1}}}) / 1000) mod 1000000000000) * 1000)) round  
                        | {{ZAHLENFORMAT: {{#expr: abs({{{1}}}) round 0}} }}
{{#ifexpr:abs({{{1}}}) > 100 |0|
                        | {{#expr: abs({{{1}}}) round 0}} }}
{{#ifexpr:abs({{{1}}}) >  10 |1|
                    | {{#ifexpr: abs({{{1}}}) > 10
                          2}} }} }}
                        | {{ZAHLENFORMAT: {{#expr: abs({{{1}}}) round 1}} }}
}} }}</includeonly>
                        | {{ZAHLENFORMAT: {{#expr: abs({{{1}}}) round 2}} }} }} }} }} }} }}</includeonly></onlyinclude>
{{Dokumentation}}