Interested Article - Round

Документация
require('strict')
local mm = require('Module:Math')

local moduleRound = {}
moduleRound.__index = moduleRound

function moduleRound:render()
	local str
	str = mm._precision_format(tonumber(self.frame:preprocess('{{#expr:'..self.args['1']..'}}')), tonumber(self.args['2']))
	return str
end

function moduleRound.new(frame, args)
	if not args then
		args = require('Module:Arguments').getArgs(frame, {wrappers = {'Template:Round'}})
		--return
	end
	local obj = {
		frame = frame,
		args = args
	}
	return setmetatable(obj, moduleRound)
end

local p = {}

function p.main(frame)
	return moduleRound.new(frame):render()
	
end

return p
Источник —

Same as Round