模組:中国各地区人口

local floor = math.floor

function region(frame)
	if frame.args[1] == "全国"  then
		return 1443497378
	end
	if frame.args[1] == "大陆"  then
		return 1411778724
	end
	if frame.args[1] == "北京"  then
		return 21893095
	end
	if frame.args[1] == "天津"  then
		return 13866009
	end
	if frame.args[1] == "河北"  then
		return 74610235
	end
	if frame.args[1] == "山西"  then
		return 34915616
	end
	if frame.args[1] == "内蒙古"  then
		return 24049155
	end
	if frame.args[1] == "辽宁"  then
		return 42591407
	end
	if frame.args[1] == "吉林"  then
		return 24073453
	end
	if frame.args[1] == "黑龙江"  then
		return 31850088
	end
	if frame.args[1] == "上海"  then
		return 24870895
	end
	if frame.args[1] == "江苏"  then
		return 84748016
	end
	if frame.args[1] == "浙江"  then
		return 64567588
	end
	if frame.args[1] == "安徽"  then
		return 61027171
	end
	if frame.args[1] == "福建"  then
		return 41540086
	end
	if frame.args[1] == "江西"  then
		return 45188635
	end
	if frame.args[1] == "山东"  then
		return 101527453
	end
	if frame.args[1] == "河南"  then
		return 99365519
	end
	if frame.args[1] == "湖北"  then
		return 57752557
	end
	if frame.args[1] == "湖南"  then
		return 66444864
	end
	if frame.args[1] == "广东"  then
		return 126012510
	end
	if frame.args[1] == "广西"  then
		return 50126804
	end
	if frame.args[1] == "海南"  then
		return 10081232
	end
	if frame.args[1] == "重庆"  then
		return 32054159
	end
	if frame.args[1] == "四川"  then
		return 83674866
	end
	if frame.args[1] == "贵州"  then
		return 38562148
	end
	if frame.args[1] == "云南"  then
		return 47209277
	end
	if frame.args[1] == "西藏"  then
		return 3648100
	end
	if frame.args[1] == "陕西"  then
		return 39528999
	end
	if frame.args[1] == "甘肃"  then
		return 25019831
	end
	if frame.args[1] == "青海"  then
		return 5923957
	end
	if frame.args[1] == "宁夏"  then
		return 7202654
	end
	if frame.args[1] == "新疆"  then
		return 25852345
	end
	if frame.args[1] == "军人"  then
		return 2000000
	end
	if frame.args[1] == "香港"  then
		return 7474200
	end
	if frame.args[1] == "澳门"  then
		return 683218
	end
	if frame.args[1] == "台湾"  then
		return 23561236
	end
end

function unit(frame)
	if frame.args[2] == "万" then
		return region(frame)/10000
	end
	if frame.args[2] == "亿" then
		return region(frame)/100000000
	end
end

function pop(frame)
	return floor(unit(frame)*math.pow(10,tonumber(frame.args[3])))/math.pow(10,tonumber(frame.args[3]))
end

return {pop = pop};