ব্যবহারকারী:Johnuniq/sandbox: সংশোধিত সংস্করণের মধ্যে পার্থক্য
বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
test to show a problem calling mw.ustring.gsub |
tweaks |
||
৩ নং লাইন:
Before the above is the code <code>local ustring = mw.ustring</code>. The above is supposed to translate bn digits to en digits, but it makes no change to text.
A test system is
*<code><nowiki>{{convert|123.4|m|mm}}</nowiki></code> → {{convert|123.4|m|mm}}
*<code><nowiki>{{convert|১২৩.৪|m|mm}}</nowiki></code> → {{convert|১২৩.৪|m|mm}}
:Conversion error: Value "১২৩.৪" must be a number
When the brute force loop is used, the second convert works. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|আলাপ]]) ০৪:০৬, ৪ জুলাই ২০১৩ (ইউটিসি)▼
Paste the following into the debug window to see the mw.log output:
<pre>
=p.convert{ args = {}, getParent = function(f) return { args = {'TEST','mm','m'} } end }
</pre>
It shows:
<pre>
=p.convert{ args = {}, getParent = function(f) return { args = {'TEST','mm','m'} } end }
mw.ustring.gsub(১২৩৪৫৬৭৮৯০, '%d', to_en_table) → ১২৩৪৫৬৭৮৯০
loop string.gsub → 1234567890
<span style="color:black; background-color:orange;">[[Module talk:Convert|Conversion error]]: Value "TEST" must be a number[[Category:Convert error]]</span>
</pre>
▲
|