Hi
The JSL script below is outputting a week number from a data in JSL. however it outputs the lower weeks as 1-9 in single digits however, I need these to appear in double digits ie 01 instead of 1, 02 instead of 2..etc.
I am hoping someone knows a way to do this, any ideas would be great.
JSL script
ST << New Column( "ww",
Numeric,
"Nominal",
Format( "Best", 12 ),
Formula( Week Of Year( :time ) )
);
If you are using JMP 13, in your script, set the format to:
Format(
"Custom",
Formula( Substr( "00", 1, 2 - Length( Char( value ) ) ) || Char( value ) ),
12
)
If you are using JMP 13, in your script, set the format to:
Format(
"Custom",
Formula( Substr( "00", 1, 2 - Length( Char( value ) ) ) || Char( value ) ),
12
)
Thanks alot Jim.
Spent ages trying to find something that could do that in the column info.
Not exactly sure how substring command is doing that but it works.
To learn about the Substr function and as a matter of fact, any of the functions, go to the Scripting Index. For info on the Substring(Substr) function:
Help==>Scripting Index==>Functions==>Character==>Substr