Difference between revisions of "User:Quonk"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Created page with "Number formatting experiments:<br> {{Infobox/Line|{{Infobox/Part/Dict|Mass}}|{{Formatnum|{{#expr: {{{mass}}}+({{{lf|0}}})*0.005+({{#if: {{{ox|}}}|{{{ox}}}|{{#if: {{{lf|}}}|{{...")
 
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
{{Infobox/Line|{{Infobox/Part/Dict|Mass}}|{{Formatnum|{{#expr: {{{mass}}}+({{{lf|0}}})*0.005+({{#if: {{{ox|}}}|{{{ox}}}|{{#if: {{{lf|}}}|{{{lf}}}*11/9|0}}}})*0.005+({{{mp|0}}})*0.004+({{{sf|0}}})*0.0075+({{{xg|0}}})*0.0001+({{{ia|0}}})*0.005+({{{or|0}}})*0.01+({{{ab|0}}})*0.001}}|2}}&nbsp;{{Dict|t}} {{{mass note|}}}{{#ifeq: {{lc:{{{physics insignificant}}}}}|y|{{#tag:ref|{{Infobox/Part/Dict|Massless}}|name="phyinsig"|group="{{{nref|N}}}"}}}}|{{#if: {{{lf|}}}{{{ox|}}}{{{mp|}}}{{{sf|}}}{{{xg|}}}{{{ia|}}}{{{or|}}}{{{ab|}}}|{{Formatnum|{{{mass}}}|2}}&nbsp;{{Dict|t}}}}
 
{{Infobox/Line|{{Infobox/Part/Dict|Mass}}|{{Formatnum|{{#expr: {{{mass}}}+({{{lf|0}}})*0.005+({{#if: {{{ox|}}}|{{{ox}}}|{{#if: {{{lf|}}}|{{{lf}}}*11/9|0}}}})*0.005+({{{mp|0}}})*0.004+({{{sf|0}}})*0.0075+({{{xg|0}}})*0.0001+({{{ia|0}}})*0.005+({{{or|0}}})*0.01+({{{ab|0}}})*0.001}}|2}}&nbsp;{{Dict|t}} {{{mass note|}}}{{#ifeq: {{lc:{{{physics insignificant}}}}}|y|{{#tag:ref|{{Infobox/Part/Dict|Massless}}|name="phyinsig"|group="{{{nref|N}}}"}}}}|{{#if: {{{lf|}}}{{{ox|}}}{{{mp|}}}{{{sf|}}}{{{xg|}}}{{{ia|}}}{{{or|}}}{{{ab|}}}|{{Formatnum|{{{mass}}}|2}}&nbsp;{{Dict|t}}}}
 +
 +
<br>
 +
 +
mass=7.1234
 +
{{Formatnum|{{{mass}}}|2}}&nbsp;{{Dict|t}} <br>
 +
<br>
 +
 +
{{Formatnum|7.1234|0}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|7.1234|1}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|7.1234|2}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|7.1234|3}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|7.1234|4}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|7.1234|5}}&nbsp;{{Dict|t}} <br>
 +
 +
<br> <br>
 +
 +
{{Formatnum|8.2345|0}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|8.2345|1}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|8.2345|2}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|8.2345|3}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|8.2345|4}}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|8.2345|5}}&nbsp;{{Dict|t}} <br>
 +
 +
<br>
 +
tests with ifexpr: <br>
 +
{{#ifexpr:  0.001 < 0.01  | very small number | normal number }} <br>
 +
{{#ifexpr:  0.009 < 0.01  | very small number | normal number }} <br>
 +
{{#ifexpr:  0.010 < 0.01  | very small number | normal number }} <br>
 +
 +
{{#ifexpr:  0.010 < 0.01  | 3 | 2 }}<br>
 +
 +
{{Formatnum|7.12345|  {{#ifexpr:  0.001 < 0.04  | 5 | 2 }}  }}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|7.12345|  {{#ifexpr:  0.009 < 0.04  | 5 | 2 }}  }}&nbsp;{{Dict|t}} <br>
 +
<br>
 +
{{Formatnum|0.03375|  {{#ifexpr:  0.03375 > 0.04  | 5 | 2 }}  }}&nbsp;{{Dict|t}} <br>
 +
{{Formatnum|0.03375|  {{#ifexpr:  0.03375 < 0.04  | 5 | 2 }}  }}&nbsp;{{Dict|t}} <br>

Latest revision as of 11:48, 7 October 2022

Number formatting experiments:

{{Infobox/Line|Mass|0.00 t |


mass=7.1234 0.00 t

7 t
7.1 t
7.12 t
7.123 t
7.1234 t
7.12340 t



8 t
8.2 t
8.23 t
8.235 t
8.2345 t
8.23450 t


tests with ifexpr:
very small number
very small number
normal number

2

7.12345 t
7.12345 t

0.03 t
0.03375 t