<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AConvertStringToNumeric</id>
	<title>Module:ConvertStringToNumeric - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AConvertStringToNumeric"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:ConvertStringToNumeric&amp;action=history"/>
	<updated>2026-06-27T13:24:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:ConvertStringToNumeric&amp;diff=471366&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:ConvertStringToNumeric&amp;diff=471366&amp;oldid=prev"/>
		<updated>2021-07-15T21:09:41Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('Module:No globals')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local lang = mw.language.getContentLanguage();									-- language object for this wiki&lt;br /&gt;
local presentation ={};															-- table of tables that contain currency presentation data&lt;br /&gt;
local properties;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; I S _ S E T &amp;gt;------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Whether variable is set or not.  A variable is set when it is not nil and not empty.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function is_set( var )&lt;br /&gt;
	return not (var == nil or var == '');&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; R E N D E R _ C O N V E R T S T R I N G T O N U M E R I C &amp;gt;------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Renders currency amount with symbol or long-form name.&lt;br /&gt;
&lt;br /&gt;
Also, entry point for other modules.  Assumes that parameters have been vetted; amount is a number, code is upper&lt;br /&gt;
case string, long_form is boolean; all are required.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function render_ConvertStringToNumeric (amount)&lt;br /&gt;
	local name;&lt;br /&gt;
	local output;&lt;br /&gt;
&lt;br /&gt;
	output = amount;&lt;br /&gt;
	output = string.gsub (output , 'thousand', '* 1000' );&lt;br /&gt;
	output = string.gsub (output , 'million',  '* 1000000' );&lt;br /&gt;
	output = string.gsub (output , 'billion',  '* 1000000000' );&lt;br /&gt;
	output = string.gsub (output , 'trillion', '* 1000000000000' );&lt;br /&gt;
	output = string.gsub (output , ',', '' );&lt;br /&gt;
	return output ;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; C O N V E R T S T R I N G T O N U M E R I C &amp;gt;--------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Template:ConvertStringToNumeric entry point.  The template takes three parameters:&lt;br /&gt;
	positional (1st), |amount=, |Amount=	: digits and decimal points only&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function ConvertStringToNumeric(frame)&lt;br /&gt;
	local args = require('Module:Arguments').getArgs (frame);&lt;br /&gt;
&lt;br /&gt;
	local amount;&lt;br /&gt;
&lt;br /&gt;
	if not is_set (args[1]) then&lt;br /&gt;
		return '&amp;lt;span style=&amp;quot;font-size:inherit&amp;quot; class=&amp;quot;error&amp;quot;&amp;gt;{{ConvertStringToNumeric}} – invalid amount ([[Template:ConvertStringToNumeric/doc#Error_messages|help]])&amp;lt;/span&amp;gt;';&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	amount = args[1];&lt;br /&gt;
	&lt;br /&gt;
	return render_ConvertStringToNumeric (amount);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	ConvertStringToNumeric = ConvertStringToNumeric,														-- template entry point&lt;br /&gt;
	_render_ConvertStringToNumeric = render_ConvertStringToNumeric,											-- other modules entry point&lt;br /&gt;
	}&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>