The value after the decimal point is not considered when calculating with the macro

Hi ,
Its function is to select the value from the row where the selected word appears in the first sheet.
The selected value is in inches and it is trying to convert to mm value that has been updating in to the second sheet .
Eg. The value in cell C131 is 6.385 inches and must be converted to a mm value.
But instead of the value of 162.179, the value of 152 comes in the second sheet.
Hope you understand, please guide me how to solve this

Sainudheen
sam1.ods (125.0 KB)

somehow logical …
dim y(7)as integer

Sub load13rd

  document = thiscomponent
  sheet1 = document.sheets(0)
  sheet2 = document.sheets(1)

  j=4
  for i=100 to 1000           
    cell_compare =sheet1.getcellbyposition(0,i)
    if cell_compare.String = "CMP" then 
        inches = sheet1.getcellbyposition(2,i).getvalue()
        millimeters = inches * 25.4   
        target =sheet2.getcellbyposition(1,j)
        target.Value = millimeters  
        j=j+1  
    end if      
  next i

  msgbox ("COMPLETED!!!","64","SAINU") 

End Sub

The whole »rocket-science« with some bytes of python:

def copy_to_mm(*_):
    doc = XSCRIPTCONTEXT.getDocument()
    source = doc.Sheets[0][:1000, :3].DataArray
    out = [[val * 25.4] for check, *_, val in source if check=="CMP"]
    target = doc.Sheets[1][ 4:len(out)+4 , 1]
    target.DataArray = out