Editing Module:Utils
From Eco - English Wiki
Your changes will be displayed to readers once an authorized user accepts them. (help)
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 392: | Line 392: | ||
fraction = mw.ustring.format("%s%s",decimalPoint, mw.ustring.sub(fraction, 2)) | fraction = mw.ustring.format("%s%s",decimalPoint, mw.ustring.sub(fraction, 2)) | ||
end | end | ||
-- Reverse the string of digits back to the original direction. | -- Reverse the string of digits back to the original direction. | ||
-- If the string digits starts with the thousands separator, remove the separator. | -- If the string digits starts with the thousands separator, remove the separator. | ||
Line 398: | Line 398: | ||
-- Need to remember to escape the thousandsSeparator, it could be "." which would translate to "any character"! | -- Need to remember to escape the thousandsSeparator, it could be "." which would translate to "any character"! | ||
return mw.ustring.format("%s%s%s", minus, mw.ustring.gsub(string.reverse(digits), mw.ustring.format("^%%s", thousandsSeparator), ""), fraction) | return mw.ustring.format("%s%s%s", minus, mw.ustring.gsub(string.reverse(digits), mw.ustring.format("^%%s", thousandsSeparator), ""), fraction) | ||
end | end | ||
return p | return p |