The World Statistics Day celebration continues here in the Community. We all need reliable data for sound decision making. Do you have a data source that you trust most? Head over to Discussions to tell us about it.
Choose Language Hide Translation Bar
Highlighted
Theresa
Level III

how to change one column to percentage format

Like change the weight column to persentage:

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

 

how to covert the "weight" column as  "95/100*100"=95%. 95% as the final result?

 

                        height  weight

KATIE small F    59    95
LOUISE small F 61 123

 

 

1 REPLY 1
Highlighted
txnelson
Super User

Re: how to change one column to percentage format

names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");
for each row(
     :weight = :weight / 100;
);
dt:weight << format("Percent",7,2);

Percent format uses 1 as 100%, and any decimal value less than 1 as the percent of 1.  Therefore .59 will be displayed as 59%

 

Jim
Article Labels

    There are no labels assigned to this post.