Template:Sprintf: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Created page with "<includeonly>{{#invoke:sprintf|main}}</includeonly><noinclude>{{/doc}}</noinclude>") |
(No difference)
|
Latest revision as of 01:47, 17 October 2024
Template documentation
This documentation is transcluded from Template:Sprintf/doc. [edit] [history] [purge]
Template:Sprintf invokes function main in Module:Sprintf using Lua.
Template:Sprintf invokes Module:sprintf using Lua.
Provides access to the lua string.format function.
Usage
{{Sprintf|format string|param1|param2|...|paramN}}
The format string is specified according to string.format, which uses printf formatting with a few exceptions. See documentation for full details. The paramters should be provided as required by the format string.
Examples
* Two strings: {{Sprintf|%s - %s|abyssal|whip}} * Floating point formatting: {{Sprintf|%3.2f|12345.678901}} * Hexadecimal conversion: {{Sprintf|%x|100}}
- Two strings: abyssal - whip
- Floating point formatting: 12345.68
- Hexadecimal conversion: 64
Template data
Show/hide template's data |
---|