Follow these steps to continue configuring a field at the dataset level using Javascript (js). See Changing the Field Display Format for initial navigation steps.
In the Edit Field Parameters window modal, under the Display Format tab, select Custom Javascript from the Category menu.
Under Custom JS Format Function, enter the following js code:
function myFunc(value) {
// Show the number in trillions with a dollar sign return
'$${value/1000000000000}';
}
Click Apply.
Save the changes to the dataset.
In this case, under Dataset: World Life Expectancy, click Save.
To verify that the format applies to all new visuals that use the field, repeat the steps in Testing the Calculated Field.
Let's compare the visuals before and after we apply the js format on the
gdp
field.