Below is the small segment of code from my script:
The logic added is to covert any data value as per the scale value
x = "11400000206633458812"
scale = 2
x = x.to_f/10**scale.to_i
x = x == x.to_i ? x.to_i : x
puts x
observe that the value comes out to be "114000002066334592"
which is different from the initial value of x.
My test-points are failing at this point.
x can be any value. If i use x = 156, the output is correct, but when the length of the integer exceeds 16 digits then the problem arises.
The expected output in above case is 114000002066334588
Can anybody help me why the value is changing and how to fix it?