Difference between revisions of "Template:Val/delimitnum"

From blackwiki
Jump to navigation Jump to search
blackwiki>Cpiral
(accept signed 4-digits as pure 4-digits)
blackwiki>Cpiral
(another "replace - with minus" needed if *signed* 4-digit numbers are not grouped)
Line 4: Line 4:
 
     |{{#invoke:String|replace|{{{1}}}|[+-]|plain=false}}}}<!-- filter sign -->
 
     |{{#invoke:String|replace|{{{1}}}|[+-]|plain=false}}}}<!-- filter sign -->
 
   <!-- Any fmt given?  If so comparison to "4" will fail -->{{{fmt|}}}
 
   <!-- Any fmt given?  If so comparison to "4" will fail -->{{{fmt|}}}
| 4 |{{{1}}}<!--  
+
| 4 |{{#invoke:String|replace|{{{1}}}|-|&minus;}}<!--  
 
If fmt is nil, found . is 0, and len is 4, then 04=4,  
 
If fmt is nil, found . is 0, and len is 4, then 04=4,  
and we just output the number.
+
and we just output the number, replacing any - with a minus sign
  
 
Else:  
 
Else:  

Revision as of 01:55, 19 June 2015

50px Template documentation[create]