Let’s create a simple Custom Transform to multiply a value by 1,000. We embed the function definition inside Add Custom Functions().
Running the above example writes “Deploying function: custom:x1000” in the JMP log. Search for this function in the Scripting Index to show that custom:x1000 is an existing function.
When you create a new formula column in a data table, the custom transform appears as shown in 图 9.10.
The last type of custom function is a custom format. You create custom formats using New Custom Function() and by specifying the Custom Format Category(1) message. Here’s an example that multiplies an input variable by 2 and also displays (x2) after the value. Note that, in this example, this function persists as a custom format and in the formula category “My New Category”. This allows you to use the format in a column formula or as a custom format.
By specifying the Custom Format Category(1) message, this format now persists under the Custom Function category in the Format menu. Here’s what this looks like when applying this new Times 2 custom format in the Column Info window:
<<Description(