<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Template%3AVal%2Fdelimitnum</id>
	<title>Template:Val/delimitnum - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Template%3AVal%2Fdelimitnum"/>
	<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Template:Val/delimitnum&amp;action=history"/>
	<updated>2026-04-08T00:08:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Template:Val/delimitnum&amp;diff=12915&amp;oldid=prev</id>
		<title>Caleb Cooper: Created page with &quot;&lt;includeonly&gt;&lt;!-- --&gt;{{#ifeq: &lt;!-- compare &quot;04&quot; to 4, and if so, output 4-digits pure   What might be &quot;04&quot; is composed of three outputs: dot, len, and fmt --&gt;   {{#invoke:Stri...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Template:Val/delimitnum&amp;diff=12915&amp;oldid=prev"/>
		<updated>2020-10-20T15:50:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;includeonly&amp;gt;&amp;lt;!-- --&amp;gt;{{#ifeq: &amp;lt;!-- compare &amp;quot;04&amp;quot; to 4, and if so, output 4-digits pure   What might be &amp;quot;04&amp;quot; is composed of three outputs: dot, len, and fmt --&amp;gt;   {{#invoke:Stri...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#ifeq: &amp;lt;!-- compare &amp;quot;04&amp;quot; to 4, and if so, output 4-digits pure&lt;br /&gt;
  What might be &amp;quot;04&amp;quot; is composed of three outputs: dot, len, and fmt --&amp;gt;&lt;br /&gt;
  {{#invoke:String|find|{{{1}}}|.}}&amp;lt;!-- Output the zero if no dot.&lt;br /&gt;
  --&amp;gt;{{#invoke:String|len &amp;lt;!-- Length of 4 with sign and spaces filtered? --&amp;gt;&lt;br /&gt;
    |{{#invoke:String|replace|{{{1}}}|[-+ ]|plain=false}}}}&amp;lt;!-- &lt;br /&gt;
    That replace just filtered out any and all spaces, + or - characters.&lt;br /&gt;
    But it&amp;#039;s gotta have the minus sign first in the [-charclass].&lt;br /&gt;
    Any fmt given?  If so comparison to &amp;quot;4&amp;quot; will fail --&amp;gt;{{{fmt|}}}&lt;br /&gt;
| 4 |{{#invoke:String|replace|{{{1}}}|-|&amp;amp;minus;}}&amp;lt;!-- &lt;br /&gt;
If fmt is nil, found . is 0, and filtered len is 4, then 04=4, &lt;br /&gt;
and we have just output the number, replacing any - with a minus sign&lt;br /&gt;
&lt;br /&gt;
Else: &lt;br /&gt;
--&amp;gt;|{{#switch: &amp;lt;!-- its not a pure 4-digit number with no fmt options given--&amp;gt;&lt;br /&gt;
{{#invoke:String|sub|{{{1|0}}}|1|1}}&lt;br /&gt;
  &amp;lt;!-- If the first char is ... --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  |- &amp;lt;!-- ... one kind of dash, or another --&amp;gt;&lt;br /&gt;
  |− = {{#ifeq:{{{nosign|off}}}|off|−}}&amp;lt;!-- output a &amp;amp;minus; sign unless nosign&lt;br /&gt;
     --&amp;gt;{{#ifeq:&lt;br /&gt;
          {{#invoke:String|sub|{{{1|0}}}|2|2}}|.|0}}&amp;lt;!--And then &lt;br /&gt;
          then if next char is . then output a zero, else do || nothing.&lt;br /&gt;
     --&amp;gt;{{#switch: {{{fmt}}} &amp;lt;!-- Format the rest of the number. --&amp;gt;&lt;br /&gt;
       |commas={{formatnum:{{#invoke:String|sub|{{{1|0}}}|2}}}}&lt;br /&gt;
       |#default = {{#invoke:Gapnum|main|{{#invoke:String|sub|{{{1|0}}}|2}}}}&lt;br /&gt;
   }} &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- follow same logic for leading + char --&amp;gt;&lt;br /&gt;
  |+={{#ifeq:{{{nosign|off}}}|off|+}}&amp;lt;!--&lt;br /&gt;
    --&amp;gt;{{#ifeq:{{#invoke:String|sub|{{{1|0}}}|2|2}}|.|0}}&amp;lt;!--&lt;br /&gt;
      --&amp;gt;{{#switch:{{{fmt}}}&lt;br /&gt;
        |commas = {{formatnum:{{#invoke:String|sub|{{{1|0}}}|2}}}}&lt;br /&gt;
        |#default = {{#invoke:Gapnum|main|{{#invoke:String|sub|{{{1|0}}}|2}}}}&lt;br /&gt;
     }} &amp;lt;!-- follow similar logic for leading . char --&amp;gt;&lt;br /&gt;
  |.=0&amp;lt;!--&lt;br /&gt;
    --&amp;gt;{{#switch:{{{fmt}}}&lt;br /&gt;
      |commas={{{1|0}}}&lt;br /&gt;
      |#default = {{#invoke:Gapnum|main|{{{1|0}}}}}&lt;br /&gt;
    }}&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!-- Else if first char is not . or - or + --&amp;gt;&lt;br /&gt;
  |#default = {{#switch:{{{fmt}}} &lt;br /&gt;
     |commas={{formatnum:{{{1|0}}}}}&lt;br /&gt;
     |#default = {{#invoke:Gapnum|main|{{{1|0}}}}}&lt;br /&gt;
      }}&lt;br /&gt;
   }}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;{{documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
</feed>