I am trying to use multiples of .05 saved in a series of local macros, and I only want two decimal places (not display format, but the content itself). Then I find this issue:
local num1 = 12*.05
local num2 = 14*.05
local sr1 = round(12*.05, .01)
local sr2 = round(14*.05, .01)
macro dir
. macro dir
...
_sr2: .7000000000000001
_sr1: .6
_num2: .7000000000000001
_num1: .6000000000000001
It seems that the round() function can deal with .6000000000000001 correctly, but not .7000000000000001. Is this a bug?
Is there another working method to get exact two-decimal numbers?
local num1 = 12*.05
local num2 = 14*.05
local sr1 = round(12*.05, .01)
local sr2 = round(14*.05, .01)
macro dir
. macro dir
...
_sr2: .7000000000000001
_sr1: .6
_num2: .7000000000000001
_num1: .6000000000000001
It seems that the round() function can deal with .6000000000000001 correctly, but not .7000000000000001. Is this a bug?
Is there another working method to get exact two-decimal numbers?
Comment