export function pxToUnit(px){
  const setting = this.$dataStore.get("setting");
  let unit = "mm";
  if (setting) {
    unit = setting.unit;
  }
  if (unit === "mm") {
    px = Number((px * 0.84183).toFixed(1));
  } else if (unit === "inch") {
    px = Number((px * 0.84183) / 25.4).toFixed(1);
  }
  return px;
}

export function unitToPx(px){
  const setting = this.$dataStore.get("setting");
  let unit = "mm";
  if (setting) {
    unit = setting.unit;
  }
  if (unit === "mm") {
    px = Number((px / 0.84183).toFixed(1));
  } else if (unit === "inch") {
    px = (Number((px / 0.84183) * 25.4).toFixed(1));
  }
  return px;
}
