YEN Function: Display Calculation Results Rounded and in Japanese Yen
The YEN function rounds a number to a specified decimal place and adds the Japanese yen currency symbol (¥) and thousands separator commas.
Use this function when you want to display a calculation result in a "Text" field in yen.
YEN function syntax
YEN(number, places)
Both the "number" and "places" arguments need to be specified.
For the "number" argument, specify a numeric value, the field code of a "Number" field, or a formula that produces a numeric value.
For the "places" argument, specify the number of decimal places to which you want to round off the resulting number. If you specify a zero or negative number for the "places" argument, the resulting number will be rounded off to the left of the decimal point (i.e., to the specified digit of the whole number).
Fields that can use the YEN function
To display results using the YEN function, use the function with a "Text" field.
Go to the settings screen of the relevant "Text" field, select the Calculate automatically checkbox, and enter a formula.
If you try to directly display results using the YEN function in a "Calculated" field, an error will occur.
However, you can use the YEN function with a "Calculated" field by placing it inside another function (e.g., as a conditional expression in an IF function).
Formula examples
When specifying a field in a formula, make sure to specify the field code as the argument (and not the field name).
In the examples below, the field code is set for each field as the field name with underscores instead of spaces (e.g., the field code for the "Price including tax" field is "Price_including_tax").
Formula to display a value in yen, rounded to the tenths place
The following formula rounds the value in a "Number" field named "Price including tax" to the tenths place and adds the yen currency symbol.
YEN(Price_including_tax, 1)
When "1132.85" is entered in the "Price including tax" field, the field set with this formula displays "¥1,132.9".
Formula to display a value in yen, rounded to the ones place
The following formula rounds the value in a "Number" field named "Price including tax" to the ones place and adds the yen currency symbol.
YEN(Price_including_tax, 0)
When "1132.85" is entered in the "Price including tax" field, the field set with this formula displays "¥1,133".
Formula to display a value in yen, rounded to the tens place
The following formula rounds the value in a "Number" field named "Price including tax" to the tens place and adds the yen currency symbol.
YEN(Price_including_tax, -1)
When "1132.85" is entered in the "Price including tax" field, the field set with this formula displays "¥1,130".