I thought it was simpler Now I'll see if I can find something more intuitive.
Your recent topics have been about UXP.
Now it seems that you are using legacy ExtendScript?
It all depends on the current resolution, I'm not sure if this helps or not?
var theRes = app.activeDocument.resolution; // PPI
var theUnitAsCM = (theRes/2.54); // 1 CM
alert("The resolution in PPI divided by 2.54:\r" + theUnitAsCM + "\r\rHowever, we can't have a floating value!");
oneCMasPX = parseInt(theUnitAsCM); // 1 CM to PX integer
alert("1 CM in PX at the current Res:\r" + oneCMasPX);