Difference between revisions of "FormatCommas"
From Sega Retro
(Created page with "<includeonly>{{#vardefine:i|0}}{{#vardefine:input|{{#replace:{{{1|}}}|<nowiki> </nowiki>|_}}}} {{#while: | {{#if:{{#sub:{{{1|}}}|{{#var:i}}}}|true}} | {{#vardefine:currentchar...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{#vardefine: | + | <includeonly>{{#vardefine:ci|0}}{{#vardefine:input|{{#replace:{{{1|}}}|<nowiki> </nowiki>|_}}}} |
{{#while: | {{#while: | ||
− | | {{#if:{{#sub:{{{1|}}}|{{#var: | + | | {{#if:{{#sub:{{{1|}}}|{{#var:ci}}}}|true}} |
− | | {{#vardefine:currentchar|{{#sub:{{#var:input}}|{{#var: | + | | {{#vardefine:currentchar|{{#sub:{{#var:input}}|{{#var:ci}}|1}}}}{{#switch:{{#var:currentchar}} |
|[={{#vardefine:link|true}} | |[={{#vardefine:link|true}} | ||
|]={{#vardefine:link}} | |]={{#vardefine:link}} | ||
Line 8: | Line 8: | ||
|,={{#if:{{#var:link}}|{{#vardefine:return|{{#var:return}},,}}|{{#vardefine:return|{{#var:return}}{{#var:currentchar}}}}}} | |,={{#if:{{#var:link}}|{{#vardefine:return|{{#var:return}},,}}|{{#vardefine:return|{{#var:return}}{{#var:currentchar}}}}}} | ||
|#default={{#vardefine:return|{{#var:return}}{{#var:currentchar}}}} | |#default={{#vardefine:return|{{#var:return}}{{#var:currentchar}}}} | ||
− | }}{{incvar| | + | }}{{incvar|ci}} |
− | }}{{#replace:{{#replace:{{#var:return}}|_|<nowiki/> <nowiki/>}}|,,|_}}</includeonly><noinclude>When storing names, [[Template:Company]] splits by commas. But some companies have commas in their names. | + | }}{{#replace:{{#replace:{{#var:return}}|_|<nowiki/> <nowiki/>}}|,,|_}}{{clearvar|ci|input|return|currentchar}}</includeonly><noinclude>When storing names, [[Template:Company]] splits by commas. But some companies have commas in their names. |
This template turns those commas into a placeholder character (_) to be swapped later. | This template turns those commas into a placeholder character (_) to be swapped later. |
Latest revision as of 09:42, 13 September 2024
When storing names, Template:Company splits by commas. But some companies have commas in their names.
This template turns those commas into a placeholder character (_) to be swapped later.
{{FormatCommas|[[Club Specialty Overseas, Inc.]], [[Sega Inc.]]}}