MiliToHwpUnit 관하여 문의 드립니다.

안녕하세요.
표의 셀크기를 조회할때 MiliToHwpUnit 매소드를 사용가능한지 문의 드립니다.

일단 아래처럼 셀크기를 80.25mm 키울때는 MiliToHwpUnit 매소드가 잘 적용 됩니다.

HAction.GetDefault("TablePropertyDialog", HParameterSet.HShapeObject.HSet);
with (HParameterSet.HShapeObject)
{
	HSet.SetItem("ShapeCellSize", 1);
	ShapeTableCell.Width = MiliToHwpUnit(80.25); //80.25mm
}
HAction.Execute("TablePropertyDialog", HParameterSet.HShapeObject.HSet);

그런데…
아래와 같은 셀크기를 조회해 볼때는 적용이 안되어서 문의 드립니다.

HAction.GetDefault("TablePropertyDialog", HParameterSet.HShapeObject.HSet);
with (HParameterSet.HShapeObject)
{
	aa = ShapeTableCell.Width;	//셀 너비(HwpUnit)
	bb = ShapeTableCell.Width / 283.4645669291339;	//셀 너비(mm로 계산)
	cc = MiliToHwpUnit(ShapeTableCell.Width);	//셀 너비(MiliToHwpUnit 메서드)
}
HAction.Execute("TablePropertyDialog", HParameterSet.HShapeObject.HSet);

XHwpMessageBox.String = "▶HwpUnit\n"+aa+"\n \n▶mm로 계산\n"+bb+"\n \n▶MiliToHwpUnit 메서드\n"+cc;
XHwpMessageBox.Flag = 0;
XHwpMessageBox.DoModal();	

두번째 처럼
HwpUnit / 283.4645669291339 이렇게 하고 소수3째 자리에서 반올림 하여 사용해야 하나요?

1개의 좋아요

안녕하세요

네 맞습니다. 한글 내부에서도 소수 셋째 자리에서 반올림하여 처리하고 있습니다.

감사합니다.

1개의 좋아요