ZPT-JS tutorial - Formatters

A formatter allows to format the evaluation of an expression. ZPT-JS includes some formatters:

You can register other formatters of your own:

context.registerFormatter( 
    'myCustomFormatter', 
    function( value ){
        return "$" + value;
    }
);
                

After registering it you will be able to use it as usual:

It is possible to run custom formatters without registering them. They must be functions defined in the dictionary: