안녕하세요, Excel로 저장된 JMP 테이블에서 반올림 소수점 이하 자릿수를 보존할 수 있는 방법이 있습니까? (.xls)
(윈도우 10/JMP 12.2)
예를 들면 다음과 같습니다. dt<
이 경우 JMP 테이블의 형식은 소수점 이하 1자리 반올림(예: 59.2)이지만 결과 Excel 테이블에는 소수점 이하 자릿수가 모두 표시됩니다(예: 59.21546).Excel 셀 색상 형식이 멋지게 보이고 JMP 테이블과 잘 어울립니다.
대신 어떻게 든 실제로 소수점을 제거해야하는지 궁금합니다. (반올림이 아니라 제거) 그렇다면 이렇게 하는 것이 좋은 방법은 무엇일까요?건배, DJ
스크립트나 큰 테이블에서 이 작업을 수행해야 하는 경우를 대비하여 다음은 Round()를 사용하라는 Jim의 제안에 대한 조잡한 구현으로 시작할 수 있습니다.
Names default to here( 1);
//Open a table and set a column width
dt = Open( "$Sample_data/iris.jmp" );
Column( dt, 2 ) << Format( "Fixed Dec", 10, 0 );
//Make a copy of the table
dt2 = dt << Subset( All rows, Selected columns only( 0 ) );
//for each column
cols = dt2 << Get Column Names;
for( i = 1, i <= N Items( cols ), i++,
//Get the format of the column and convert it to a list
frmt = Column( dt2, cols[i] ) << Get Format;
frmt = Parse("{" || Regex(char(name expr(frmt)), "Format\((.*)\)", "\1") || "}");
//if formatted as a fixed decimal
if(frmt[1] == "Fixed Dec",
//Set the actual value to the rounded number
Column( dt2, cols[i] ) << Set Values(
Round(
Column( dt2, cols[i] ) << Get Values,
frmt[3]
)
)
)
);
//Save the table and open the temp files
dt2 << Save( "$Temp/mytable.xls", xls );
Open( "$Temp" );
//close the copied table
dt2 << Close Window;Format() 또는 Round() 함수를 사용하여 JMP에서 절대 mvales를 자를 수 있으므로 데이터를 업로드할 때 도움이 될 수 있습니다.그러나 둘 다 데이터의 정확성을 떨어뜨릴 것입니다.