こんにちは、Excel として保存された JMP テーブルから四捨五入された小数点以下の桁数を保持する方法はありますか? (.xls)
(Windows10/JMP12.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 を切り捨てることができます。これは、データをアップロードするときに役立ちます。しかし、どちらもデータの精度の一部を低下させます。