Content deleted Content added
→Functions: isnumeric |
+Cat |
||
(2 intermediate revisions by one other user not shown) | |||
Line 148:
A startswith function similar to {{ml|string|endswith}}. Both parameters are required, although they can be blank. Leading and trailing whitespace ''is'' counted, use named parameters to avoid this if required. Outputs "yes" for true and blank for false so may be passed directly to #if.
{{markup|padding=1px 5px|
<nowiki>{{#invoke:string2|startswith|search|se}}</nowiki>|{{#invoke:string2|startswith|search|se}}|
<nowiki>{{#invoke:string2|startswith|search|ch}}</nowiki>|{{#invoke:string2|startswith|search|ch}}}}<!-- Template:Mra -->
Line 155:
Implements {{tl|isnumeric}}, which tests whether a value is numeric (or at least, that it can be treated as such by the [[:mw:Extension:Scribunto/Lua_reference_manual#Language_library|Scribunto language library]]). By default, it will pass through the parameter if it's numeric and be blank if it's not. If the parameter <code>boolean=true</code> is given, then it will output <code>1</code> if numeric and <code>0</code> if not numeric.
{{markup|padding=1px 5px|
<nowiki>{{#invoke:string2|isnumeric|1,327.50}}</nowiki>|{{#invoke:string2|isnumeric|1,327.50}}|
<nowiki>{{#invoke:string2|isnumeric|9,999 (1950)}}</nowiki>|{{#invoke:string2|isnumeric|9,999 (1950)}}|
Line 304:
<includeonly>{{Sandbox other||
[[Category:Modules that manipulate strings|*]]
[[Category:Template metamodules]]
}}</includeonly>
|