17,105
edits
No edit summary |
(round: Amend such that result remains with maxDigits dp when decimals > maxDigits) |
||
Line 183: | Line 183: | ||
if(maxDigits ~= nil and decimals > maxDigits) then | if(maxDigits ~= nil and decimals > maxDigits) then | ||
result = | result = string.format("%."..maxDigits.."f", result) | ||
elseif(minDigits ~= nil and decimals < minDigits) then | elseif(minDigits ~= nil and decimals < minDigits) then | ||
result = string.format("%."..minDigits.."f", result) | result = string.format("%."..minDigits.."f", result) |