Convert class | QSYS API Reference Guide

Estimated reading time: 5 minutes

Converts a base data type to another base data type, using RPG type conversion rules.

Namespace: ASNA.QSys.Runtime Assembly: ASNA.QSys.Runtime.dll

Inheritance: Object

Methods

Signature Description
ToByte(String) Converts the value of the specified string to an equivalent byte value, using RPG type conversion rules.
ToDecimal(String) Converts the specified string representation of a number to an equivalent decimal number.
ToDouble(String) Converts the specified string representation of a number to an equivalent double-precision floating-point number.
ToInt16(Decimal) Converts the value of the specified decimal number to an equivalent 16-bit signed integer, using RPG type conversion rules.
ToInt16(String) Converts the value of the specified string to an equivalent 16-bit signed integer, using RPG type conversion rules.
ToInt32(Decimal) Converts the value of the specified decimal number to an equivalent 32-bit signed integer, using RPG type conversion rules.
ToInt32(String) Converts the value of the specified string to an equivalent 32-bit signed integer, using RPG type conversion rules.
ToInt64(String) Converts the value of the specified string to an equivalent 64-bit signed integer, using RPG type conversion rules.
ToSingle(String) Converts the specified string representation of a number to an equivalent single-precision floating-point number.

byte ToByte(string theString)

Converts the value of the specified string to an equivalent byte value, using RPG type conversion rules.

byte ToByte(string theString)

Parameters

Type Parameter name Description
String theString The string to convert.

Returns

Type Description
Byte The resulting byte value, or 0 (zero) if the string is null or blanks.

decimal ToDecimal(string theString)

Converts the specified string representation of a number to an equivalent decimal number.

decimal ToDecimal(string theString)

Parameters

Type Parameter name Description
String theString A string that contains a number to convert.

Returns

Type Description
Decimal A decimal number that is equivalent to the number in value, or 0 (zero) if value is null or blanks.

double ToDouble(string theString)

Converts the specified string representation of a number to an equivalent double-precision floating-point number.

double ToDouble(string theString)

Parameters

Type Parameter name Description
String theString A string that contains the number to convert.

Returns

Type Description
Double A double-precision floating-point number that is equivalent to the number in value, or 0 (zero) if value is null or blanks.

short ToInt16(decimal theDecimal)

Converts the value of the specified decimal number to an equivalent 16-bit signed integer, using RPG type conversion rules.

short ToInt16(decimal theDecimal)

Parameters

Type Parameter name Description
Decimal theDecimal The decimal number to convert.

Returns

Type Description
Int16 The resulting 16-bit signed integer.

short ToInt16(string theString)

Converts the value of the specified string to an equivalent 16-bit signed integer, using RPG type conversion rules.

short ToInt16(string theString)

Parameters

Type Parameter name Description
String theString The string to convert.

Returns

Type Description
Int16 The resulting 16-bit signed integer, or 0 (zero) if value is null or blanks.

int ToInt32(decimal theDecimal)

Converts the value of the specified decimal number to an equivalent 32-bit signed integer, using RPG type conversion rules.

int ToInt32(decimal theDecimal)

Parameters

Type Parameter name Description
Decimal theDecimal The decimal number to convert.

Returns

Type Description
Int32 The resulting 32-bit signed integer.

int ToInt32(string theString)

Converts the value of the specified string to an equivalent 32-bit signed integer, using RPG type conversion rules.

int ToInt32(string theString)

Parameters

Type Parameter name Description
String theString The string to convert.

Returns

Type Description
Int32 The resulting 32-bit signed integer, or 0 (zero) if value is null or blanks.

long ToInt64(string theString)

Converts the value of the specified string to an equivalent 64-bit signed integer, using RPG type conversion rules.

long ToInt64(string theString)

Parameters

Type Parameter name Description
String theString The string to convert.

Returns

Type Description
Int64 The resulting 64-bit signed integer, or 0 (zero) if value is null or blanks.

float ToSingle(string theString)

Converts the specified string representation of a number to an equivalent single-precision floating-point number.

float ToSingle(string theString)

Parameters

Type Parameter name Description
String theString A string that contains the number to convert.

Returns

Type Description
Single A single-precision floating-point number that is equivalent to the number in value, or 0 (zero) if value is null or blanks.