Difference between revisions of "Template:Coord/negzeropad"
Jump to navigation
Jump to search
imported>Para m (moved User:Para/negzeropad to Template:Coord/negzeropad) |
imported>Para (doc) |
||
| Line 1: | Line 1: | ||
| − | <includeonly>{{#ifexpr:{{{1}}}<0|{{#switch:_{{{1}}}|_-{{{2}}}={{{2}}}|_-{{{2}}}0={{{2}}}0|_-{{{2}}}.0={{{2}}}.0|_-{{{2}}}00={{{2}}}00|_-{{{2}}}.00={{{2}}}.00|_-{{{2}}}000={{{2}}}000|_-{{{2}}}.000={{{2}}}.000|_-{{{2}}}0000={{{2}}}0000|_-{{{2}}}.0000={{{2}}}.0000|_-{{{2}}}00000={{{2}}}00000|_-{{{2}}}.00000={{{2}}}.00000|{{{2}}}}}|{{{1}}}}}</includeonly> | + | <includeonly>{{#ifexpr:{{{1}}}<0|{{#switch:_{{{1}}}|_-{{{2}}}={{{2}}}|_-{{{2}}}0={{{2}}}0|_-{{{2}}}.0={{{2}}}.0|_-{{{2}}}00={{{2}}}00|_-{{{2}}}.00={{{2}}}.00|_-{{{2}}}000={{{2}}}000|_-{{{2}}}.000={{{2}}}.000|_-{{{2}}}0000={{{2}}}0000|_-{{{2}}}.0000={{{2}}}.0000|_-{{{2}}}00000={{{2}}}00000|_-{{{2}}}.00000={{{2}}}.00000|{{{2}}}}}|{{{1}}}}}</includeonly><noinclude>{{template doc}}</noinclude> |
Revision as of 16:12, 5 January 2009
Adds zeros to the end of new until it is the same as the negative original without its sign. Used with functions that have done new=abs(original) and lost precision.
{{Coord/negzeropad|original|new}}
Example: {{Coord/negzeropad|-1.200|1.2}} becomes 1.200</includonly>
| The above documentation is transcluded from Template:Coord/negzeropad/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |