Difference between revisions of "Template:Sigfigs"

From Kerbal Space Program Wiki
Jump to: navigation, search
Line 1: Line 1:
{{#ifeq: {{{1}}}|N/A|N/A|{{formatnum|{{#expr: <!--
+
<includeonly>{{#ifeq: {{{1}}}|N/A|N/A|{{#ifexpr: abs(floor(ln({{{1}}})/ln(10))) + 1>{{{2}}}|{{formatnum|{{#expr: {{{1}}}/10^floor(ln({{{1}}})/ln(10)) round {{{2}}} - 1}}|{{#expr: {{{2}}} - 1}}}}×10<sup>{{formatnum|{{#expr: floor(ln({{{1}}})/ln(10))}}}}</sup>|{{formatnum|{{{1}}}|{{#expr: {{{2}}}-{{#ifexpr: ln({{{1}}}) >= 0|abs(floor(ln({{{1}}})/ln(10)))-1|0}}}}}}}}}}</includeonly><noinclude>
--> floor( 0.5 + <!--
 
-->    {{{1|12345678901234567890}}} <!--
 
-->    / 10^( <!--
 
-->        floor(ln({{{1|12345678901234567890}}}) / ln(10)) <!--
 
-->        + 1 - {{{2|5}}} <!--
 
-->    ) <!--
 
--> ) <!--
 
--> * ( <!--
 
-->    10^( <!--
 
-->        floor(ln({{{1|12345678901234567890}}}) / ln(10)) <!--
 
-->         + 1 - {{{2|5}}} <!--
 
-->     ) <!--
 
--> ) <!--
 
--> }}}}}}<noinclude>{{Box|notice.svg|'''This template is currently not properly working.''' However [[User:XZise]] is trying to fix this template.|#aaaaff|}}
 
  
 
{| class="wikitable"
 
{| class="wikitable"

Revision as of 13:06, 6 April 2013


Usage Produces
{{sigfigs|12345678901234567890|5}}
1.2346×1019
{{sigfigs|0.123456789012345678|5}}
0.12346