JMP salva come Excel (perde il formato decimale)Ciao, c'è un modo per preservare il numero di decimali arrotondati da una tabella JMP salvata come Excel? (.xls)
(Windows 10/JMP 12.2)
Quindi, ad esempio: dt<
In questo caso, la tabella JMP ha un formato di 1 cifra decimale arrotondata (es. 59.2), ma la tabella Excel risultante mostra tutte le cifre decimali (es. 59.21546).I formati di colore delle celle di Excel hanno un bell'aspetto e corrispondono bene alla tabella JMP.
Mi chiedo se devo effettivamente rimuovere i decimali in qualche modo? (non arrotondamento, ma rimozione) In tal caso, qual è un buon modo per farlo?ciao, dj
Re: JMP salva come Excel (perde il formato decimale)Nel caso in cui tu abbia bisogno di farlo in uno script o su un grande tavolo, ecco un'implementazione grezza del suggerimento di Jim di usare Round() che potrebbe farti iniziare.
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;Re: JMP salva come Excel (perde il formato decimale)È possibile utilizzare le funzioni Format() o Round() per troncare gli mvales assoluti in JMP, che possono essere utili quando si caricano i dati.Ma entrambi ridurranno parte della precisione dei dati.