Template:NumberFormatPad: Difference between revisions

From The Wiki Camp 2 Jr.
Jump to navigation Jump to search
m (namespacing)
No edit summary
 
Line 1: Line 1:
<onlyinclude>{{#vardefine:_nmfmpd_numlen|{{#invoke:String|len|{{#number_format:{{{1}}}|0|||{{{5|}}}}}}}}}{{#ifexpr:{{{pad|0}}}>{{#var:_nmfmpd_numlen}}|{{#loop:_nmfmpd_i|{{{pad}}}|{{#expr:{{#var:_nmfmpd_numlen}}-{{{pad}}}}}|0{{#ifexpr:{{#var:_nmfmpd_i}}mod3=1|{{#switch:{{{4}}}|n=&nbsp;|t=&thinsp;|{{{4|,}}}}}}}}}}}{{#number_format:{{{1}}}|{{{2|0}}}|{{{3|.}}}|{{{4|,}}}|{{{5|}}}}}</onlyinclude>
<onlyinclude>{{#vardefine:_nmfmpd|{{#number_format:{{{1}}}|_|.||{{{5|}}}}}}}{{#ifexpr:{{#var:_nmfmpd}}<0|-{{#vardefine:_nmfmpd|{{#expr:abs{{#var:_nmfmpd}}}}}}|{{#if:{{{sgn|}}}|+}}}}{{#vardefine:_nmfmpd_numlen|{{#invoke:String|len|{{#expr:{{#var:_nmfmpd}}round0}}}}}}{{#ifexpr:{{{pad|0}}}>{{#var:_nmfmpd_numlen}}|{{#loop:_nmfmpd_i|{{{pad}}}|{{#expr:{{#var:_nmfmpd_numlen}}-{{{pad}}}}}|0{{#ifexpr:{{#var:_nmfmpd_i}}mod3=1|{{#switch:{{{4}}}|n=&nbsp;|t=&thinsp;|{{{4|,}}}}}}}}}}}{{#number_format:{{#var:_nmfmpd}}|{{{2|0}}}|{{{3|.}}}|{{{4|,}}}}}</onlyinclude>
 
* {{NumberFormatPad|0|pad=1}}
* {{NumberFormatPad|0|pad=1}}
* {{NumberFormatPad|1|pad=1}}
* {{NumberFormatPad|1|pad=1}}
Line 37: Line 36:
* {{NumberFormatPad|123456.789|2|.|t|pad=7}}
* {{NumberFormatPad|123456.789|2|.|t|pad=7}}
* {{NumberFormatPad|1234567|pad=7}}
* {{NumberFormatPad|1234567|pad=7}}
* {{NumberFormatPad|+1234|pad=7}}
* {{NumberFormatPad|-1234|pad=7}}
* {{NumberFormatPad|+1234|pad=7|sgn=Y}}
* {{NumberFormatPad|-1234|pad=7|sgn=Y}}

Latest revision as of 01:09, 11 September 2024

1

  • 0
  • 1
  • 00
  • 01
  • 12
  • 123,456
  • 000
  • 001
  • 012
  • 123
  • 0,000
  • 0,001
  • 0,012
  • 0,123
  • 1,234
  • 00,000
  • 00,001
  • 00,012
  • 00,123
  • 01,234
  • 12,345
  • 000,000
  • 000,001
  • 000,012
  • 000,123
  • 001,234
  • 012,345
  • 123.456,7891235
  • 0.000.098,7891234560
  • 0,000,001
  • 0,000,012
  • 0,000,123
  • 0,001,234
  • 0 012 345.68
  • 0 123 456.79
  • 1,234,567
  • 0,001,234
  • -0,001,234
  • +0,001,234
  • -0,001,234