标签:local 数字 .com span tps www. pre 数位 sed
--- nNum 源数字
--- n 小数位数
function Tool. GetPreciseDecimal(nNum, n)
if type(nNum) ~= "number" then
return nNum;
end
n = n or 0;
n = math.floor(n)
if n < 0 then
n = 0;
end
local nDecimal = 10 ^ n
local nTemp = math.floor(nNum * nDecimal);
local nRet = nTemp / nDecimal;
return nRet;
end
参考:https://www.cnblogs.com/pk-run/p/4444582.html
标签:local 数字 .com span tps www. pre 数位 sed
原文地址:https://www.cnblogs.com/zhaoqingqing/p/9026523.html