Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
m Archiving 1 discussion(s) from Module talk:Wd) (bot |
||
Line 1,159:
::@[[User:MSGJ|MSGJ]], that wouldn't work unless you want to list a conversion, though, right? The specific example that prompted this request doesn't fall into that category (see [[Special:Diff/1154043077|this diff]]), nor do many others. <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span> <sup>[[User talk:Sdkb|'''talk''']]</sup> 22:00, 9 May 2023 (UTC)
:::Oh, I was thinking if there were units then it was probably a convertible quantity — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 22:55, 9 May 2023 (UTC)
== Non-ASCII numeric delimiter ==
This is probably not so important for enwiki, but people are copying the module to other wikis and might find it useful. When the <code>["numeric"]["delimiter"]</code> in [[Module:Wd/i18n]] is set to a non-7bit-ASCII value (for example, to <code>mw.ustring.char(0x202f)</code>, [[narrow no-break space]]) the <code>:reverse</code> method reverses UTF character bytes in
:<code style="font-size:90%">return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter'])''':reverse())''' .. right</code>
A quick solution is to first use some symmetric ascii-7 ''improbable'' character combination, such as <code>!@!</code>:
:<code style="font-size:90%">local temp_delimiter = (num:reverse():gsub("(%d%d%d)", "%1" .. "!@!"):reverse())</code>
:<code style="font-size:90%">return left .. temp_delimiter:gsub("!@!", p['numeric']['delimiter']) .. right</code>
[[User:Ponor|Ponor]] ([[User talk:Ponor|talk]]) 14:33, 26 May 2023 (UTC)
|