cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
LogitTurtle576
Level III

Changing column format only for numeric ones via JSL

Hi,

 

I can't figure out how to change the format for all numeric columns in my table to be with just 2 dec. via JSL.

The following code is sending errors because it tries to do it for non numeric columns too.

 

For( i = 2, i <= N Col( dt ), i++,
    Column( dt, i ) << Format( "Fixed Dec", 12, 2 )
);

 

Thanks in advance for any help.

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Changing column format only for numeric ones via JSL

Check Data type first with

<< Get Data Type

and compare it in If-statement

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Changing column format only for numeric ones via JSL

Check Data type first with

<< Get Data Type

and compare it in If-statement

-Jarmo
David_Burnham
Super User (Alumni)

Re: Changing column format only for numeric ones via JSL

FYI, you can also get a list of only numeric columns

lst = dt << get column names(numeric);
-Dave

Recommended Articles