Template:Val/delimitnum: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Cpiral
accept signed 4-digits as pure 4-digits
meta>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