Skip to main content

5-4-2 Conversion functions

SVFX-Designer provides the following conversion functions.

Restriction

"NUMSTR" and "NUMVAL" can only be used in Japanese forms.

Function name

Feature

TOASC

Converts full-width characters into half-width characters.

TOJIS

Converts half-width characters into full-width characters.

TOLOWER

Converts uppercase alphabetical characters into lowercase.

TOUPPER

Converts lowercase alphabetical characters into uppercase.

ABS

Retrieves the absolute value as numeric-type data.

ASC

Retrieves a character as numeric-type data (decimal).

CHR

Converts decimal data into a character.

INT

Truncates fractional digits to display data as an integer.

ROUND

Rounds off numeric-type data beginning at the specified digit.

STR

Converts numeric-type data into text-type data.

VAL

Converts text-type data into numeric-type data.

NUMSTR

Converts numeric-type data into text-type data (Kanji numbers).

NUMVAL

Converts text-type data (Kanji numbers) into numeric-type data.

TOASC

Feature

Converts full-width characters into half-width characters.

Format

TOASC(string)

The characters that can be converted are as follows.

△!"#$%&'()*+,-./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[¥]^_
`abcdefghijklmno
pqrstuvwxyz{|}~

Reference

sdCommon_iTri_W_Up.gif indicates a full-width space.

Settings

In "string", specify the text-type data to be converted, or the name of the field that contains the data.

Usage examples

When converting the character string "123ABCabc" to a half-width character string

  • Edit-formula: TOASC("123ABCabc")

  • Printing result: 123ABCabc

Restriction

Characters that are not applicable are not converted.

TOJIS

Feature

Converts half-width characters into full-width characters.

Format

TOJIS(string)

The characters that can be converted are as follows.

▲!"#$%&'()*\+,-./ 
0123456789:;<=>?   
@ABCDEFGHIJKLMNO   
PQRSTUVWXYZ[\]^_  
`abcdefghijklmno   
pqrstuvwxyz{|}~

Reference

sdCommon_iTri_B_Up.gif indicates a half-width space.

Settings

In "string", specify the text-type data to be converted, or the name of the field that contains the data.

Usage examples

When converting the character string "123ABCabc" to a full-width character string

  • Edit-formula: TOJIS("123ABCabc")

  • Printing result: 123ABCabc

Restriction

Characters that are not applicable are not converted.

TOLOWER

Feature

Converts uppercase alphabetical characters into lowercase.

Format

TOLOWER(string<,conversion mode>)

  • Conversion mode

    • 0: No conversion

    • 1: Converts only ASC characters (half-width alphabetical characters)

    • 2: Converts only JIS characters (full-width alphabetical characters)

    • 3: Converts both ASC/JIS characters (default value when mode is not specified)

Settings

In "string", specify the text-type data to be converted, or the name of the field that contains the data.

Usage examples

  • Example 1: When you do not want to convert the character string "ABCABC"

    • Edit-formula: TOLOWER("ABCABC",0)

    • Printing result: ABCABC

  • Example 2: When converting only the half-width upper case characters in the character string "ABCABC" to lower case

    • Edit-formula: TOLOWER("ABCABC",1)

    • Printing result: abcABC

  • Example 3: When converting only the full-width upper case characters in the character string "ABCABC" to lower case

    • Edit-formula: TOLOWER("ABCABC",2)

    • Printing result: ABCabc

  • Example 4: When converting all of the upper case characters in the character string "ABCABC" to lower case

    • Edit-formula: TOLOWER("ABCABC",3)

    • Printing result: abcabc

  • Example 5: When omitting the conversion mode and defaulting to mode 3

    • Edit-formula: TOLOWER("ABCABC")

    • Printing result: abcabc

Reference

Full-width characters are shown in bold.

Restriction

Characters that are not applicable are not converted.

TOUPPER

Feature

Converts lowercase alphabetical characters into uppercase.

Format

TOUPPER(string<,conversion mode>)

  • Conversion mode

    • 0: No conversion

    • 1: Converts only ASC characters (half-width alphabetical characters)

    • 2: Converts only JIS characters (full-width alphabetical characters)

    • 3: Converts both ASC/JIS characters (default value when mode is not specified)

Settings

In "string", specify the text-type data to be converted, or the name of the field that contains the data.

Usage examples

  • Example 1: When you do not want to convert the character string "abcabc"

    • Edit-formula: TOUPPER("abcabc",0)

    • Printing result: abcabc

  • Example 2: When converting only the half-width lower case characters in the character string "abcabc" to upper case

    • Edit-formula: TOUPPER("abcabc",1)

    • Printing result: ABCabc

  • Example 3: When converting only the full-width lower case characters in the character string "abcabc" to upper case

    • Edit-formula: TOUPPER("abcabc",2)

    • Printing result: abcABC

  • Example 4: When converting all of the lower case characters in the character string "abcabc" to upper case

    • Edit-formula: TOUPPER("abcabc",3)

    • Printing result: ABCABC

  • Example 5: When omitting the conversion mode and defaulting to mode 3

    • Edit-formula: TOUPPER("abcabc")

    • Printing result: ABCABC

Reference

Full-width characters are shown in bold.

Restriction

Characters that are not applicable are not converted.

ABS

Feature

Retrieves the absolute value as numeric-type data.

Format

ABS(numeric_value_or_numeric_field_name)

Settings

In "numeric_value_or_numeric_field_name", specify the numeric value to retrieve the absolute value, or the name of the field that contains the data.

Caution

Because the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result.

Usage examples

Prerequisite

When "-65" is entered in the numeric field "I1"

  • Example 1: When printing the absolute value of the field "I1" to the numeric field "I2"

    • Edit-formula: FORMAT(ABS(I1),"ZZ9")

    • Printing result: "sdCommon_iTri_W_Up.gif65" (sdCommon_iTri_W_Up.gif = half-width space)

  • Example 2: When retrieving the absolute value of the field "I1", and using it as the value of the numeric field "I2"

    • Calculation-formula: ABS(I1)

    • Printing result: 65

ASC

Feature

Retrieves a character as numeric-type data (decimal).

Format

ASC(character_or_character_field_name)

Settings

In "character_or_character_field_name", specify the text-type data to be converted to ASCII code, or the name of the field that contains the data.

Restriction

IVS and Thai are not supported.

Usage examples

Prerequisite

When data "A" is entered in the text field "S1"

  • Example 1: When printing the ASCII code (in decimal) of the field "S1" to the numeric field "I2"

    • Edit-formula: FORMAT(ASC(S1), "ZZ9")

    • Printing result: "sdCommon_iTri_W_Up.gif65" (sdCommon_iTri_W_Up.gif = half-width space)

  • Example 2: When retrieving the ASCII code (in decimal) of the field "S1", and using it as the value of the numeric field "I2"

    • Calculation-formula: ASC(S1)

    • Printing result: 65

CHR

Feature

Converts decimal data into a character.

Format

CHR(numeric_value_or_numeric_field_name)

Settings

In "numeric_value_or_numeric_field_name", specify the numeric-type data to be converted to character data, or the name of the field that contains the data.

Reference

The decimal number specified here is the Unicode code in decimal format.

Restriction

  • Do not use control codes (0x00~0x1F, 0x7F~0xA0, except for the CR and LF line feed codes) for conversion.

  • IVS and Thai are not supported.

Usage examples

Prerequisite

When "65" is entered in the numeric field "I1"

  • Example 1: When converting the ASCII code of the field "I1", and printing to the text field "S2"

    • Edit-formula: CHR(I1)

    • Printing result: "A"

  • Example 2: When converting the ASCII code of the field "I1", and using as the value of the text field "S2"

    • Calculation-formula: CHR(I1)

    • Printing result: "A"

INT

Feature

Truncates fractional digits to display data as an integer.

Format

INT(numeric_value_or_numeric_field_name)

Settings

In "numeric_value_or_numeric_field_name", specify the numeric-type data to convert into an integer by truncating the digits after the decimal point, or the name of the field that contains the data.

Caution

Because the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result.

Usage examples

Prerequisite

When "2.567" is entered in the numeric field "I1"

  • Example 1: When truncating the decimal digits of the value of the field "I1", and printing the integer value to the numeric field "I2"

    • Edit-formula: FORMAT(INT(I1), "ZZ9")

    • Printing result: "sdCommon_iTri_W_Up.gifsdCommon_iTri_W_Up.gif2" (sdCommon_iTri_W_Up.gif = half-width space)

  • Example 2: When truncating the decimal digits of the value of the field "I1", and using the integer value as the value of the numeric field "I2"

    • Calculation-formula: INT(I1)

    • Printing result: 2

ROUND

Feature

Rounds off numeric-type data beginning at the specified digit.

Format

ROUND(numeric_value_or_numeric_field_name,index)

Settings

  1. In "numeric_value_or_numeric_field_name", specify the numeric-type data to be rounded off, or the name of the field that contains the data.

  2. In "index", specify the digit at which to start rounding off the value.

How to set the number of digits

Number of digits

Number of digits to execute for

Positive numbers

Digits beginning at the specified integer position are rounded off

0 (zero)

Digits after the decimal point are rounded off

Negative numbers

Digits beginning after the specified decimal position are rounded off

Settings for "index" to begin rounding off "123.456" at the corresponding digit

1

2

3

.

4

5

6

+3

+2

+1

0

-1

-2

Value set in "index"

Caution

Because the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result.

Usage examples

Prerequisite

When "123.456" is entered in the numeric field "I1"

  • Example 1: When rounding the value of the field "I1" to the first digit after the decimal point, and printing to the numeric field "I2"

    • Edit-formula: FORMAT(ROUND(I1,-1),"ZZ9.99")

    • Printing result: "123.50"

  • Example 2: When rounding the value of the field "I1" to the first digit after the decimal point, and using it as the value of the numeric field "I2"

    • Calculation-formula: ROUND(I1,-1)

    • Printing result: 123.5

STR

Feature

Converts numeric-type data into text-type data.

Format

STR(numeric_value_or_numeric_field_name<,total_length<,length_of_fractional_part>>)

Settings

  1. In "numeric_value_or_numeric_field_name", specify the numeric-type data to convert, or the name of the field that contains the data.

  2. In "total_length", specify the number of digits of data to retrieve (including the decimal point) after converting.

  3. In "length_of_fractional_part", specify the decimal precision to include within "total_length" (round off the "n+1" decimal place).

  4. This will convert "numeric_value_or_numeric_field_name" to text-type data using the number of characters specified in "total_length" (inclusive of the bytes for decimals in "length_of_fractional_part").

Setting details

Print Status

If "total_length" is larger than the bytes for the entire data, and "length_of_fractional_part" is omitted

Print all the data.

If the number of bytes for the entire data is larger than "total_length", and "length_of_fractional_part" is specified

Integer: Print all digits

Decimal: Print the number of digits specified in "length_of_fractional_part"

Reference

  • The "<,total_length<,length_of_fractional_part>>" of the parameter can be omitted.

  • If you omit "<,total_length<,length_of_fractional_part>>", the seventh digit after the decimal point will be rounded off.

Usage examples

Prerequisite

When "123.456" is entered in the numeric field "I1"

  • Example 1: When converting numeric-type data from the field "I1" to text-type data, and printing to the text field "S2"

    • Edit-formula: STR(I1)

    • Printing result: "123.456"

  • Example 2: When converting numeric-type data from the field "I1" to text-type data, and using as the value of the text field "S2"

    • Calculation-formula: STR(I1)

    • Printing result: "123.456"

  • Example 3: When converting numeric-type data from the field "I1" to text-type data, and printing an eight-digit value to the text field "S2", including the first two digits after the decimal point

    • Edit-formula: STR(I1,8,2)

    • Printing result: "sdCommon_iTri_W_Up.gifsdCommon_iTri_W_Up.gif123.46" (third digit after the decimal point is rounded off) (sdCommon_iTri_W_Up.gif = half-width space)

VAL

Feature

Converts text-type data into numeric-type data.

Format

VAL(numeric_string_or_character_field_name)

Settings

  1. In "numeric_string_or_character_field_name", specify the text-type data to convert, or the name of the field that contains the data.

  2. This will replace "numeric_string_or_character_field_name" with numeric-type data.

Caution

Because the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result.

Usage examples

Prerequisite

When "123.456" is entered in the text field "S1"

  • Example 1: When converting text-type data from the field "S1" to numeric-type data, and printing to the numeric field "I2"

    • Edit-formula: FORMAT(VAL(S1), "ZZ9.999")

    • Printing result: "123.456"

  • Example 2: When converting text-type data from the field "S1" to numeric-type data, and using it as the value of the numeric field "I2"

    • Calculation-formula: VAL(S1)

    • Printing result: 123.456

NUMSTR

Feature

Converts numeric-type data into text-type data (Kanji numbers).

Format

NUMSTR(numeric_value_or_numeric_field_name<,conversion mode>)

  • Conversion mode

    • 1: Converts numeric-type data to text-type data using formal Kanji numbers (used in place of simple Kanji numbers) + "円" (yen)

    • 2: Converts numeric-type data to text-type data using simple Kanji numbers + "円" (yen)

    • 3: Converts numeric-type data to text-type data using simple Kanji numbers

Settings

In "numeric_value_or_numeric_field_name", specify the numeric-type data to convert, or the name of the field that contains the data.

Reference

  • The "<,conversion_mode>" in the parameter can be omitted. If omitted, conversion mode "3" is used.

  • The maximum number of digits of numeric-type data that can be specified is 37 digits.

Usage examples

Prerequisite

When "123456789" is entered in the numeric field "I1"

  • Example 1: When converting numeric-type data from the field "I1" to text-type data using formal Kanji numbers + "円" (yen), and printing to the text field "S2"

    • Edit-formula: NUMSTR(I1,1)

    • Printing result: "壱億弐仟参佰肆拾伍萬陸仟漆佰捌拾玖円"

  • Example 2: When converting numeric-type data from the field "I1" to text-type data using simple Kanji numbers + "円" (yen), and printing to the text field "S2"

    • Edit-formula: NUMSTR(I1,2)

    • Printing result: "一億二千三百四十五万六千七百八十九円"

  • Example 3: When converting numeric-type data from the field "I1" to text-type data using simple Kanji numbers, and printing to the text field "S2"

    • Edit-formula: NUMSTR(I1,3)

    • Printing result: "一億二千三百四十五万六千七百八十九"

NUMVAL

Feature

Converts text-type data (Kanji numbers) into numeric-type data.

Format

NUMVAL(numeric_string_or_character_field_name<,conversion mode>)

  • Conversion mode

    • 1: Only converts text-type data using formal Kanji numbers (used in place of simple Kanji numbers) + "円" (yen)

    • 2: Only converts text-type data using simple Kanji numbers + "円" (yen)

    • 3: Only converts text-type data using simple Kanji numbers

Settings

  1. In "numeric_string_or_character_field_name", specify the text-type data to convert, or the name of the field that contains the data.

  2. This will replace "numeric_string_or_character_field_name" with numeric-type data.

Caution

Because the value is retrieved as numeric-type data, if the function is used in the edit-formula, the value must be converted into text-type data by using the FORMAT or STR function before using the result.

Reference

  • The "<,conversion_mode>" in the parameter can be omitted. If omitted, conversion mode "3" is used.

  • The maximum number of digits of numeric-type data that can be retrieved is 37 digits.

Usage examples

  • Prerequisite 1

    When "壱億弐仟参佰肆拾伍萬陸仟漆佰捌拾玖円" is entered in the text field "S1"

    Example: When converting text-type data (Kanji numbers) from the field "S1" to numeric-type data, and printing to the numeric field "I2"

    • Edit-formula: FORMAT(NUMVAL(S1,1),"ZZZZZZZZ9")

    • Printing result: "123456789"

  • Prerequisite 2

    When "一億二千三百四十五万六千七百八十九円" is entered in the text field "S1"

    Example: When converting text-type data (Kanji numbers) from the field "S1" to numeric-type data, and printing to the numeric field "I2"

    • Edit-formula: FORMAT(NUMVAL(S1,2),"ZZZZZZZZ9")

    • Printing result: "123456789"

  • Prerequisite 3

    When "一億二千三百四十五万六千七百八十九" is entered in the text field "S1"

    Example: When converting text-type data (Kanji numbers) from the field "S1" to numeric-type data, and printing to the numeric field "I2"

    • Edit-formula: FORMAT(NUMVAL(S1,3),"ZZZZZZZZ9")

    • Printing result: "123456789"

Restriction

Characters that are not applicable are not converted.