Format a number as currency scripted field

Problem

You would like to display a numeric custom field as currency.

Solution

This script assumes there is a SIL alias for the custom field containing the number value.

return formatNumber(someNumber, "$###,###.0#");

Example output: $16,546,987.21