a!swissFranc() Function

Function

a!swissFranc( number, decimals, noApostrophes, showPrefixSymbol )

Converts the number into a Swiss franc value. Effectively adds a decimal point and an apostrophe for every three digits preceding the decimal. It also adds an optional Swiss franc symbol preceding the value.

Parameters

Keyword Type Description

number

Decimal

The number of Swiss francs to be returned as text.

decimals

Optional

(Integer) The number of digits after the decimal to display. 2 by default.

noApostrophes

Optional

(Integer) This parameter is optional and can be 0 or 1. By default this value is 0. When 0, the Swiss franc value will be separated by apostrophes every three digits preceding the decimal. When 1, the Swiss franc value is not separated by apostrophes.

showPrefixSymbol

Optional

(Integer) This parameter is optional and can be 0 or 1. By default this value is 0. When 1, the Swiss franc value will be prefixed by the symbol 'CHF', otherwise, no symbol will be prefixed to the Swiss franc value.

Returns

Text

Usage considerations

Using the Swiss franc prefix symbol

The Swiss franc prefix symbol (CHF) is not shown by default. Use the showPrefixSymbol to add the symbol before the value. If no arguments are passed, the Swiss franc symbol itself is returned as text.

Using the decimals parameter

If no decimals value is passed, the function uses 2 by default.

Examples

You can experiment with this function in the test box below.

Test Input

a!swissFranc(3213.43) returns 3'213.43

a!swissFranc(number: 3213.43, showPrefixSymbol: 1) returns CHF 3'213.43

Open in Github Built: Fri, Oct 22, 2021 (11:09:30 AM)

On This Page

FEEDBACK