Skip to main content

Number and Currency

N&C tab.png

The Number and Currency tab is where you control the settings that determine how numbers and currency values appear in your project output. The tab is split into the following sections:

Important

To reset all Number and Currency settings to their system defaults, click SET TO DEFAULTS at the bottom of the tab.

Locale

A locale is a code representing a language and country. The first two letters represent the language, and the second two represent the country. The two parts are separated by an underscore or hyphen. For example, the locale en_US is for English, United States.

The locale defines which characters are displayed as decimal and thousand separators when a number is displayed in your output. This locale applies to all numbers displayed in your project output except those you format differently using a formatting function.

All supported locales are available from the LOCALE drop-down:

Locale.png

This locale applies to all numbers in your project. In addition, the numberFormat and currencyFormat functions use it as the default for their LOCALE parameter.

Important

This setting does not affect the use of locales in datetime functions.

Number formatting

This is where you set the default number format pattern for your project. This pattern applies to all numbers displayed in your project output except those you format differently using a formatting function.

Common patterns are available from the NUMBER FORMAT drop-down. Alternatively, define your own pattern by typing in the text field:

Number Format.png

The pattern is defined using Java's DecimalFormat syntax. See Syntax for number format patterns for a helpful guide.

Any call to the numberFormat function uses this pattern as the default for its FORMAT parameter.

Currency formatting

This is where you control the project default values for the currencyFormat function. Any call to the function will use these defaults unless you specify different values using the function’s optional parameters.

Select a currency format pattern from the CURRENCY FORMAT drop-down or define your own pattern by typing in the text field:

Currency Format.png

The pattern is defined using Java's DecimalFormat syntax. See Syntax for number format patterns for a helpful guide.

The CURRENCY setting defines the currency unit. The currency unit is given as a three-letter code, e.g. JPY for the Japanese Yen, or CAD for the Canadian Dollar. All valid entries are available from the drop-down:

Currency.png

The NEGATIVE RED setting controls whether negative results are displayed in red text (true) or text in the standard color (false).

Negative Red.png

Abbreviation

Here you control the project default values for the abbreviateNumber function. Any call to the function will use these defaults unless you specify different values using the function’s optional parameters.

ABBREVIATION THRESHOLD defines the number below which no abbreviation occurs.

Abbreviation Threshold.png

The next four settings allow you to choose symbols (or suffixes) for abbreviating numbers in the thousands, millions, billions, and trillions. Either select one of the displayed symbols or select other and type a symbol/suffix of your choice in the CUSTOM text field that appears below.

Abbreviation Symbols.png

Tip

To include a space between the number and suffix (e.g. 100 K), add a space before typing the suffix in the CUSTOM text field.

DECIMAL PLACES FOR ABBREVIATION defines the maximum number of decimal places displayed.

Abbreviation_DP.png

The STRIP TRAILING ZEROS FOR ABBREVIATION setting has two options: true ensures trailing zeros are stripped; false ensures that trailing zeros are retained.

Abbreviation_STZ.png

Precision

Here you control the project default values for the precision function. Any call to the function will use these defaults unless you specify different values using the function's optional parameters.

DECIMAL PLACES FOR PRECISION defines the maximum number of decimal places displayed.

Precision_DP.png

STRIP TRAILING ZEROS FOR PRECISION has two options: true ensures trailing zeros are stripped; false ensures that trailing zeros are retained.

Precision_STZ.png

Rounding

Here you control the project default values for the round function. Any call to the function will use these defaults unless you specify different values using the function’s optional parameters.

DECIMAL PLACES FOR ROUNDING defines the number of decimal places that numbers are rounded to.

Round_DP.png

Enter a number in the field. Alternatively, select inherit from the drop-down to ensures that the number of decimal places is inherited from the input number's existing display format.

STRIP TRAILING ZEROS FOR ROUNDING has three options: true ensures trailing zeros are stripped, false ensures that trailing zeros are retained, and inherit ensures that the decision to strip or retain trailing zeros is based on the input number's existing display format.

Round_STZ.png

Important

The round topic explains the idea of inherit in greater detail.

Percentage

Here you control the project default values for the percentage function. Any call to the function will use these defaults unless you specify different values using the function’s optional parameters.

DECIMAL PLACES FOR PERCENTAGE defines the maximum number of decimal places displayed.

Percentage_DP.png

Enter a number in the text box or select useNumberFormat from the drop-down to ensure that the number of decimal places is taken from the NUMBER FORMAT setting.

STRIP TRAILING ZEROS FOR PERCENTAGE has three options: true ensures trailing zeros are stripped, false ensures that trailing zeros are retained, and useNumberFormat ensures that the decision to strip or retain trailing zeros is determined by the NUMBER FORMAT setting.

Percentage_STZ.png

PercentageChange

Here you control the project default values for the percentageChange function. Any call to the function will use these defaults unless you specify different values using the function’s optional parameters.

DECIMAL PLACES FOR PERCENTAGECHANGE defines the maximum number of decimal places displayed.

PC_DP.png

Enter a number in the field or select useNumberFormat from the drop-down to ensure that the number of decimal places is taken from the NUMBER FORMAT setting.

STRIP TRAILING ZEROS FOR PERCENTAGECHANGE has three options: true ensures trailing zeros are stripped, false ensures that trailing zeros are retained, and useNumberFormat ensures that the decision to strip or retain trailing zeros is determined by the NUMBER FORMAT setting.

PC_STZ.png

PercentageChangeAcrossSeries

Here you control the project default values for the percentageChangeAcrossSeries function. Any call to the function will use these defaults unless you specify different values using the function’s optional parameters.

DECIMAL PLACES FOR PERCENTAGECHANGEACROSSSERIES defines the maximum number of decimal places displayed.

PCAS_DP.png

Enter a number in the field or select useNumberFormat from the drop-down to ensure that the number of decimal places is taken from the NUMBER FORMAT setting.

STRIP TRAILING ZEROS FOR PERCENTAGECHANGEACROSSSERIES has three options: true ensures trailing zeros are stripped, false ensures that trailing zeros are retained, and useNumberFormat ensures that the decision to strip or retain trailing zeros is determined by the NUMBER FORMAT setting.

PCAS_STZ.png

Note

There are no settings for percentageChangeAcrossSeries in "Describe Each Row" and "Describe a JSON Object" projects.

Advanced

To access the advanced settings, scroll to the bottom of the screen and click on this arrow:

Advanced

Legacy behaviors

Studio handled number formatting differently before the release of version 3.1.0. The LEGACY BEHAVIORS setting handles backward compatibility for certain number behaviors.

Generally, you control the default formatting for numbers using the LOCALE and NUMBER FORMAT settings described above. The LEGACY BEHAVIORS setting applies only to three specific behaviors, all of which are described below.

Legacy.png

The setting has two options: legacy and numberFormat. These allow you to manage backward compatibility in three respects:

  1. NUMBER TO STRING COERCION

    The number-to-string coercer is used when a function expects a string for its parameter value but is given a number instead. In such cases, Studio automatically coerces the number to a string.

    Mode

    Behavior

    legacy

    The coercer formats the input number to a maximum of 7 decimal places and no thousand separators are used. Half-up rounding is also automatically applied.

    numberFormat

    The coercer formats the input number using the project's default number format pattern, unless the number is already formatted using a formatting function.

  2. RESULTS FROM A MATHEMATICAL CALCULATION

    This covers how Studio displays the result of a mathematical computation, e.g. the output of a mathematical function.

    Mode

    Behavior

    legacy

    The result is displayed to a maximum of 7 decimal places with trailing zeros stripped. This is the equivalent of using the pattern #,##0.#######).

    numberFormat

    If one or more numbers used in the calculation are formatted, and all those are formatted identically, the result is displayed using that same formatting. Otherwise, the result is formatted using the project's default number format pattern.

  3. FORMATTING FOR A LIST OF NUMBERS

    This covers how a list of numbers is displayed in the output text.

    Mode

    Behavior

    legacy

    Each number in the list is displayed to a maximum of 7 decimal places and no thousand separators are used. Half-up rounding is also automatically applied.

    numberFormat

    Each number in the list is displayed as it would be outside the list, i.e. each number in the list is formatted using the project's default number format pattern unless different formatting is applied using a formatting function.

Important

Projects published before the release of Studio 3.1.0 will open for the first time (following the 3.1.0 release) in legacy mode. This is to ensure backward compatibility. All other projects will be in numberFormat mode.

If making further edits to a legacy project, we strongly recommend you switch to numberFormat mode. This is because legacy mode does not support abbreviateNumber, currencyFormat, numberFormat, and precision.

Tip

The best way to switch from legacy to numberFormat is to click the SET DEFAULTS button. This resets all Number and Currency settings to their system defaults (i.e. how they would be set if you opened a new project).