标签:
time:2015/04/21
1. string.format()
function GetPreciseDecimal(nNum, n) if type(nNum) ~= "number" then return nNum; end n = n or 0; n = math.floor(n) local fmt = ‘%.‘ .. n .. ‘f‘ local nRet = tonumber(string.format(fmt, nNum)) return nRet; end
标签:
原文地址:http://www.cnblogs.com/pk-run/p/4444582.html