Numformat
From NEC Retro
Revision as of 11:48, 28 December 2021 by Black Squirrel (talk | contribs) (Created page with "{{#ifexpr:{{#len:{{{1|}}}}}>3 |{{#if:{{#pos:{{{1|}}}|,}}|{{#replace:{{{1|}}}|,}} |{{clearvar|nfout}}{{#vardefine:pos|-3}}{{#while:|{{#ifexpr:({{#var:pos}}*-1)<{{#len:{{{1|}}}}...")
Revision as of 11:48, 28 December 2021 by Black Squirrel (talk | contribs) (Created page with "{{#ifexpr:{{#len:{{{1|}}}}}>3 |{{#if:{{#pos:{{{1|}}}|,}}|{{#replace:{{{1|}}}|,}} |{{clearvar|nfout}}{{#vardefine:pos|-3}}{{#while:|{{#ifexpr:({{#var:pos}}*-1)<{{#len:{{{1|}}}}...")
Inserts or removes commas from numbers that are 1,000 or larger.
Usage
- {{numformat|123}} -> 123
- {{numformat|1234}} -> 1,234
- {{numformat|1,234}} -> 1234
- {{numformat|1234567890}} -> 1,234,567,890
- {{numformat|123456789}} -> 123,456,789