DecimalMethods class | QSYS API Reference Guide
Estimated reading time: 40 minutes
Contains extension methods for handling RPG operations for decimal numbers.
Namespace: ASNA.QSys.Runtime Assembly: ASNA.QSys.Runtime.dll
Inheritance: Object
Methods
| Signature | Description | 
|---|---|
| ApplyEditWord(Decimal, String) | ApplyEditWord summary. | 
| GetDigits(Decimal, Int32, Int32, Int32) | Extracts digits from a decimal number. | 
| GetDigits(Decimal, Int32, Int32, Int32, Int32) | Extracts digits from a decimal number. | 
| GetDigits(Decimal, Int32, Int32, Int32, Int32, Int32) | Extracts digits from a decimal number. | 
| MoveLeft(Decimal, Int32, Int32, Decimal, Int32, Int32) | RPG’s MOVEL. Moves left a decimal to a decimal. | 
| MoveLeft(Decimal, Int32, Int32, String) | RPG’s MOVEL. Moves left decimal to a string. | 
| MoveLeft(Decimal, Int32, Int32, DateTime, DateTimeDataKind, DateTimeFormat) | RPG’s MOVEL. Moves left a decimal into a DateTime. | 
| MoveLeft(Decimal, Int32, Int32, Int16) | RPG’s MOVEL. Moves left a decimal to an int2 (short). | 
| MoveLeft(Decimal, Int32, Int32, Int32) | RPG’s MOVEL. Moves left a decimal to an int4 (int). | 
| MoveLeft(Decimal, Int32, Int32, Int64) | RPG’s MOVEL. Moves left a decimal to an int8 (long). | 
| MoveLeftToChar(Decimal, Int32, Int32) | RPG’s MOVEL. Moves right a decimal to a char. | 
| MoveLeftWithPad(Decimal, Int32, Int32, Int32, Int32) | RPG’s MOVEL. Moves left a decimal to a decimal with pad. | 
| MoveLeftWithPad(Decimal, Int32, Int32, String) | RPG’s MOVEL. Moves left decimal to a string, with pad. | 
| MoveLeftWithPad(Decimal, Int32, Int32, DateTime, DateTimeDataKind, DateTimeFormat) | RPG’s MOVEL. Moves left a decimal into a DateTime with pad. | 
| MoveLeftWithPad(Decimal, Int32, Int32, Int16) | RPG’s MOVEL. Moves left a decimal to an int2 (short) with pad. | 
| MoveLeftWithPad(Decimal, Int32, Int32, Int32) | RPG’s MOVEL. Moves left a decimal to an int4 (int) with pad. | 
| MoveLeftWithPad(Decimal, Int32, Int32, Int64) | RPG’s MOVEL. Moves left a decimal to an int8 (long) with pad. | 
| MoveRight(Decimal, Decimal, Int32, Int32) | RPG’s MOVE. Moves right a decimal to a decimal. | 
| MoveRight(Decimal, Int32, Int32, String) | RPG’s MOVE. Moves right decimal to a string. | 
| MoveRight(Decimal, Int32, Int32, DateTime, DateTimeDataKind, DateTimeFormat) | RPG’s MOVE. Moves right a decimal into a DateTime. | 
| MoveRight(Decimal, Int32, Int32, Int16) | RPG’s MOVE. Moves right a decimal to an int2 (short). | 
| MoveRight(Decimal, Int32, Int32, Int32) | RPG’s MOVE. Moves right a decimal to an int4 (int). | 
| MoveRight(Decimal, Int32, Int32, Int64) | RPG’s MOVE. Moves right a decimal to an int8 (long). | 
| MoveRightToChar(Decimal, Int32, Int32) | RPG’s MOVE. Moves right a decimal to a char. | 
| MoveRightWithPad(Decimal, Int32, Int32) | RPG’s MOVE. Moves right a decimal to a decimal with pad. | 
| MoveRightWithPad(Decimal, Int32, Int32, String) | RPG’s MOVE. Moves right decimal to a string, with pad. | 
| MoveRightWithPad(Decimal, Int32, Int32, DateTime, DateTimeDataKind, DateTimeFormat) | RPG’s MOVE. Moves right a decimal into a DateTime with pad. | 
| MoveRightWithPad(Decimal, Int32, Int32, Int16) | RPG’s MOVE. Moves right a decimal to an int2 (short) with pad. | 
| MoveRightWithPad(Decimal, Int32, Int32, Int32) | RPG’s MOVE. Moves right a decimal to an int4 (int) with pad. | 
| MoveRightWithPad(Decimal, Int32, Int32, Int64) | RPG’s MOVE. Moves right a decimal to an int8 (long) with pad. | 
| RoundUp(Decimal, Int32) | Rounds up a decimal number to the desired decimal positions. | 
| SetDigits(Decimal, Int32, Int32, Decimal, Int32) | Replaces contiguous digits in a decimal number. | 
| SetDigits(Decimal, Int32, Int32, Decimal, Int32, Int32) | Replaces contiguous digits in a decimal number. | 
| SetDigits(Decimal, Int32, Int32, Decimal, Int32, Int32, Int32) | Replaces contiguous digits in a decimal number. | 
| Sum(Decimal[]) | Returns the added values of each element in the array. | 
| Sum(Single[]) | Returns the added values of each element in the array. | 
| Sum(Double[]) | Returns the added values of each element in the array. | 
| TestTime(Decimal, Int32, Int32, DateTimeDataKind, DateTimeFormat) | Tests whether a decimal number contains a valid date/time/timestamp value. | 
| ToDate(Decimal, DateTimeFormat) | ToDate summary. | 
| ToDecimal<T>(T) | Converts a value of type T to decimal. | 
| ToFixedDecimal(Decimal, Int32, Int32) | Adjusts the digits and decimal positions of a fixed decimal number. | 
| ToFixedDecimal(Decimal, Int32) | Truncates a decimal to the specified number of decimal positions. | 
| ToFixedDecimalRounded(Decimal, Int32, Int32) | Adjusts the digits and decimal positions of a fixed decimal number using Away From Zero rounding. | 
| ToFixedDecimalRounded(Decimal, Int32) | Rounds a decimal to the specified number of decimal positions using Away From Zero rounding. | 
| ToStringBinary(Decimal, Int32, Int32) | Returns as a string the ‘memory’ representation of a binary decimal number. | 
| ToStringPacked(Decimal, Int32) | Returns as a string the ‘memory’ representation of a packed decimal number. | 
| ToStringZoned(Decimal, Int32, Int32) | Returns as a string the ‘memory’ representation of a zoned decimal number. | 
| ToTime(Decimal, DateTimeFormat) | ToTime summary. | 
| ToTimestamp(Decimal) | ToTimestamp summary. | 
string ApplyEditWord(decimal num, string editwordString)
ApplyEditWord summary.
string ApplyEditWord(decimal num, string editwordString)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | ApplyEditWord num param. | 
| String | editwordString | ApplyEditWord editwordString param. | 
Returns
| Type | Description | 
|---|---|
| String | ApplyEditWord returns. | 
decimal GetDigits(decimal num, int digits, int decimals, int start)
Extracts digits from a decimal number.
decimal GetDigits(decimal num, int digits, int decimals, int start)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number. | 
| Int32 | digits | The number of digits the decimal number contains. | 
| Int32 | decimals | The number of decimal positions. | 
| Int32 | start | The 0-based starting position. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number that contains the extracted digits. | 
decimal GetDigits(decimal num, int digits, int decimals, int start, int length)
Extracts digits from a decimal number.
decimal GetDigits(decimal num, int digits, int decimals, int start, int length)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number. | 
| Int32 | digits | The number of digits the decimal number contains. | 
| Int32 | decimals | The number of decimal positions. | 
| Int32 | start | The 0-based starting position. | 
| Int32 | length | The count of digits to extract. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number that contains the extracted digits. | 
decimal GetDigits(decimal num, int digits, int decimals, int start, int length, int resDecimals)
Extracts digits from a decimal number.
decimal GetDigits(decimal num, int digits, int decimals, int start, int length, int resDecimals)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number. | 
| Int32 | digits | The number of digits the decimal number contains. | 
| Int32 | decimals | The number of decimal positions. | 
| Int32 | start | The 0-based starting position. | 
| Int32 | length | The count of digits to extract. | 
| Int32 | resDecimals | The decimal positions of the resulting decimal number. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number that contains the extracted digits. | 
decimal MoveLeft(decimal num, int sourceDig, int sourceDec, decimal targetOperand, int targetOperandDig, int targetOperandDec)
RPG’s MOVEL. Moves left a decimal to a decimal.
decimal MoveLeft(decimal num, int sourceDig, int sourceDec, decimal targetOperand, int targetOperandDig, int targetOperandDec)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Decimal | targetOperand | Decimal value of the targetOperand number. | 
| Int32 | targetOperandDig | number of digits in the targetOperand. | 
| Int32 | targetOperandDec | number of decimal places in the targetOperand. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The resulting decimal value of the operation. | 
string MoveLeft(decimal num, int sourceDig, int sourceDec, string targetOperand)
RPG’s MOVEL. Moves left decimal to a string.
string MoveLeft(decimal num, int sourceDig, int sourceDec, string targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| String | targetOperand | targetOperand string. | 
Returns
| Type | Description | 
|---|---|
| String | The resulting string value of the operation. | 
DateTime MoveLeft(decimal num, int sourceDig, int sourceDec, DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)
RPG’s MOVEL. Moves left a decimal into a DateTime.
DateTime MoveLeft(decimal num, int sourceDig, int sourceDec, DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| DateTime | dateTime | Date, Time, Timestamp. | 
| DateTimeDataKind | dateTimeKind | DateTime Kind. | 
| DateTimeFormat | dateTimeFormat | DateTime Format. | 
Returns
| Type | Description | 
|---|---|
| DateTime | The resulting DateTime value of the operation. | 
short MoveLeft(decimal num, int sourceDig, int sourceDec, short targetOperand)
RPG’s MOVEL. Moves left a decimal to an int2 (short).
short MoveLeft(decimal num, int sourceDig, int sourceDec, short targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int16 | targetOperand | short value of the targetOperand. | 
Returns
| Type | Description | 
|---|---|
| Int16 | The resulting short value of the operation. | 
int MoveLeft(decimal num, int sourceDig, int sourceDec, int targetOperand)
RPG’s MOVEL. Moves left a decimal to an int4 (int).
int MoveLeft(decimal num, int sourceDig, int sourceDec, int targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int32 | targetOperand | The int value target of the operation. | 
Returns
| Type | Description | 
|---|---|
| Int32 | The resulting int value of the operation. | 
long MoveLeft(decimal num, int sourceDig, int sourceDec, long targetOperand)
RPG’s MOVEL. Moves left a decimal to an int8 (long).
long MoveLeft(decimal num, int sourceDig, int sourceDec, long targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int64 | targetOperand | The long value target of the operation. | 
Returns
| Type | Description | 
|---|---|
| Int64 | The resulting long value of the operation. | 
char MoveLeftToChar(decimal num, int sourceDig, int sourceDec)
RPG’s MOVEL. Moves right a decimal to a char.
char MoveLeftToChar(decimal num, int sourceDig, int sourceDec)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
Returns
| Type | Description | 
|---|---|
| Char | The first character in the string representation of the decimal value. | 
decimal MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, int targetOperandDig, int targetOperandDec)
RPG’s MOVEL. Moves left a decimal to a decimal with pad.
decimal MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, int targetOperandDig, int targetOperandDec)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int32 | targetOperandDig | number of digits in the targetOperand. | 
| Int32 | targetOperandDec | number of decimal places in the targetOperand. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The resulting decimal value of the operation. | 
string MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, string targetOperand)
RPG’s MOVEL. Moves left decimal to a string, with pad.
string MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, string targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| String | targetOperand | targetOperand string. | 
Returns
| Type | Description | 
|---|---|
| String | The resulting string value of the operation. | 
DateTime MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)
RPG’s MOVEL. Moves left a decimal into a DateTime with pad.
DateTime MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| DateTime | dateTime | Date, Time, Timestamp. | 
| DateTimeDataKind | dateTimeKind | DateTime Kind. | 
| DateTimeFormat | dateTimeFormat | DateTime Format. | 
Returns
| Type | Description | 
|---|---|
| DateTime | The resulting DateTime value of the operation. | 
short MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, short targetOperand)
RPG’s MOVEL. Moves left a decimal to an int2 (short) with pad.
short MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, short targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int16 | targetOperand | short value of the targetOperand. | 
Returns
| Type | Description | 
|---|---|
| Int16 | The resulting short value of the operation. | 
int MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, int targetOperand)
RPG’s MOVEL. Moves left a decimal to an int4 (int) with pad.
int MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, int targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int32 | targetOperand | The int value target of the operation. | 
Returns
| Type | Description | 
|---|---|
| Int32 | The resulting int value of the operation. | 
long MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, long targetOperand)
RPG’s MOVEL. Moves left a decimal to an int8 (long) with pad.
long MoveLeftWithPad(decimal num, int sourceDig, int sourceDec, long targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int64 | targetOperand | The long value target of the operation. | 
Returns
| Type | Description | 
|---|---|
| Int64 | The resulting long value of the operation. | 
decimal MoveRight(decimal num, decimal targetOperand, int targetOperandDig, int targetOperandDec)
RPG’s MOVE. Moves right a decimal to a decimal.
decimal MoveRight(decimal num, decimal targetOperand, int targetOperandDig, int targetOperandDec)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Decimal | targetOperand | Decimal value of the targetOperand number. | 
| Int32 | targetOperandDig | number of digits in the targetOperand. | 
| Int32 | targetOperandDec | number of decimal places in the targetOperand. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The resulting decimal value of the operation. | 
string MoveRight(decimal num, int sourceDig, int sourceDec, string targetOperand)
RPG’s MOVE. Moves right decimal to a string.
string MoveRight(decimal num, int sourceDig, int sourceDec, string targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| String | targetOperand | targetOperand string. | 
Returns
| Type | Description | 
|---|---|
| String | The resulting string value of the operation. | 
DateTime MoveRight(decimal num, int sourceDig, int sourceDec, DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)
RPG’s MOVE. Moves right a decimal into a DateTime.
DateTime MoveRight(decimal num, int sourceDig, int sourceDec, DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| DateTime | dateTime | Date, Time, Timestamp. | 
| DateTimeDataKind | dateTimeKind | DateTime Kind. | 
| DateTimeFormat | dateTimeFormat | DateTime Format. | 
Returns
| Type | Description | 
|---|---|
| DateTime | The resulting DateTime value of the operation. | 
short MoveRight(decimal num, int sourceDig, int sourceDec, short targetOperand)
RPG’s MOVE. Moves right a decimal to an int2 (short).
short MoveRight(decimal num, int sourceDig, int sourceDec, short targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int16 | targetOperand | short value of the targetOperand. | 
Returns
| Type | Description | 
|---|---|
| Int16 | The resulting short value of the operation. | 
int MoveRight(decimal num, int sourceDig, int sourceDec, int targetOperand)
RPG’s MOVE. Moves right a decimal to an int4 (int).
int MoveRight(decimal num, int sourceDig, int sourceDec, int targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int32 | targetOperand | The int value target of the operation. | 
Returns
| Type | Description | 
|---|---|
| Int32 | The resulting int value of the operation. | 
long MoveRight(decimal num, int sourceDig, int sourceDec, long targetOperand)
RPG’s MOVE. Moves right a decimal to an int8 (long).
long MoveRight(decimal num, int sourceDig, int sourceDec, long targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int64 | targetOperand | The long value target of the operation. | 
Returns
| Type | Description | 
|---|---|
| Int64 | The resulting long value of the operation. | 
char MoveRightToChar(decimal num, int sourceDig, int sourceDec)
RPG’s MOVE. Moves right a decimal to a char.
char MoveRightToChar(decimal num, int sourceDig, int sourceDec)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
Returns
| Type | Description | 
|---|---|
| Char | The last character in the string representation of the decimal value. | 
decimal MoveRightWithPad(decimal num, int targetOperandDig, int targetOperandDec)
RPG’s MOVE. Moves right a decimal to a decimal with pad.
decimal MoveRightWithPad(decimal num, int targetOperandDig, int targetOperandDec)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | targetOperandDig | number of digits in the targetOperand. | 
| Int32 | targetOperandDec | number of decimal places in the targetOperand. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The resulting decimal value of the operation. | 
string MoveRightWithPad(decimal num, int sourceDig, int sourceDec, string targetOperand)
RPG’s MOVE. Moves right decimal to a string, with pad.
string MoveRightWithPad(decimal num, int sourceDig, int sourceDec, string targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| String | targetOperand | targetOperand string. | 
Returns
| Type | Description | 
|---|---|
| String | The resulting string value of the operation. | 
DateTime MoveRightWithPad(decimal num, int sourceDig, int sourceDec, DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)
RPG’s MOVE. Moves right a decimal into a DateTime with pad.
DateTime MoveRightWithPad(decimal num, int sourceDig, int sourceDec, DateTime dateTime, DateTimeDataKind dateTimeKind, DateTimeFormat dateTimeFormat)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| DateTime | dateTime | Date, Time, Timestamp. | 
| DateTimeDataKind | dateTimeKind | DateTime Kind. | 
| DateTimeFormat | dateTimeFormat | DateTime Format. | 
Returns
| Type | Description | 
|---|---|
| DateTime | The resulting DateTime value of the operation. | 
short MoveRightWithPad(decimal num, int sourceDig, int sourceDec, short targetOperand)
RPG’s MOVE. Moves right a decimal to an int2 (short) with pad.
short MoveRightWithPad(decimal num, int sourceDig, int sourceDec, short targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int16 | targetOperand | short value of the targetOperand. | 
Returns
| Type | Description | 
|---|---|
| Int16 | The resulting short value of the operation. | 
int MoveRightWithPad(decimal num, int sourceDig, int sourceDec, int targetOperand)
RPG’s MOVE. Moves right a decimal to an int4 (int) with pad.
int MoveRightWithPad(decimal num, int sourceDig, int sourceDec, int targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int32 | targetOperand | The int value target of the operation. | 
Returns
| Type | Description | 
|---|---|
| Int32 | The resulting int value of the operation. | 
long MoveRightWithPad(decimal num, int sourceDig, int sourceDec, long targetOperand)
RPG’s MOVE. Moves right a decimal to an int8 (long) with pad.
long MoveRightWithPad(decimal num, int sourceDig, int sourceDec, long targetOperand)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | Decimal value of the source number. | 
| Int32 | sourceDig | number of digits in the source. | 
| Int32 | sourceDec | number of decimal places in the source. | 
| Int64 | targetOperand | The long value target of the operation. | 
Returns
| Type | Description | 
|---|---|
| Int64 | The resulting long value of the operation. | 
decimal RoundUp(decimal num, int decimalCount)
Rounds up a decimal number to the desired decimal positions.
decimal RoundUp(decimal num, int decimalCount)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The number to round up. | 
| Int32 | decimalCount | The desired number of decimal positions. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal value rounded up to the given decimal positions. | 
decimal SetDigits(decimal num, int digits, int decimals, decimal replace, int start)
Replaces contiguous digits in a decimal number.
decimal SetDigits(decimal num, int digits, int decimals, decimal replace, int start)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The number that will have its digits replaced. | 
| Int32 | digits | The length of num. | 
| Int32 | decimals | The decimal positions of num. | 
| Decimal | replace | The number that will replace the digits of num. | 
| Int32 | start | The 0-based position in num where the replacement will start. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number after replacing digits. | 
decimal SetDigits(decimal num, int digits, int decimals, decimal replace, int start, int length)
Replaces contiguous digits in a decimal number.
decimal SetDigits(decimal num, int digits, int decimals, decimal replace, int start, int length)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The number that will have its digits replaced. | 
| Int32 | digits | The length of num. | 
| Int32 | decimals | The decimal positions of num. | 
| Decimal | replace | The number that will replace the digits of num. | 
| Int32 | start | The 0-based position in num where the replacement will start. | 
| Int32 | length | The length (digits) of the replacement. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number after replacing digits. | 
decimal SetDigits(decimal num, int digits, int decimals, decimal replace, int start, int repDigits, int repDecimals)
Replaces contiguous digits in a decimal number.
decimal SetDigits(decimal num, int digits, int decimals, decimal replace, int start, int repDigits, int repDecimals)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The number that will have its digits replaced. | 
| Int32 | digits | The length of num. | 
| Int32 | decimals | The decimal positions of num. | 
| Decimal | replace | The number that will replace the digits of num. | 
| Int32 | start | The 0-based position in num where the replacement will start. | 
| Int32 | repDigits | The length (digits) of the replacement. | 
| Int32 | repDecimals | The decimal positions of the replacement. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number after replacing digits. | 
decimal Sum(Decimal[] array)
Returns the added values of each element in the array.
decimal Sum(Decimal[] array)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal[] | array | The array whose elements will be summed. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The added value of every element in the array. | 
float Sum(Single[] array)
Returns the added values of each element in the array.
float Sum(Single[] array)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Single[] | array | The array whose elements will be summed. | 
Returns
| Type | Description | 
|---|---|
| Single | The added value of every element in the array. | 
double Sum(Double[] array)
Returns the added values of each element in the array.
double Sum(Double[] array)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Double[] | array | The array whose elements will be summed. | 
Returns
| Type | Description | 
|---|---|
| Double | The added value of every element in the array. | 
bool TestTime(decimal num, int digits, int decimals, DateTimeDataKind kind, DateTimeFormat format)
Tests whether a decimal number contains a valid date/time/timestamp value.
bool TestTime(decimal num, int digits, int decimals, DateTimeDataKind kind, DateTimeFormat format)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number to test. | 
| Int32 | digits | The length of the decimal number. | 
| Int32 | decimals | The decimal positions of the decimal number. | 
| DateTimeDataKind | kind | whether the number represents a date, time, or timestamp. | 
| DateTimeFormat | format | The date/time/timestamp format in which the number is. | 
Returns
| Type | Description | 
|---|---|
| Boolean | True if the number represents a valid date/time/timestamp value in the given format. False otherwise. | 
DateTime ToDate(decimal source, DateTimeFormat format)
ToDate summary.
DateTime ToDate(decimal source, DateTimeFormat format)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | source | ToDate source param. | 
| DateTimeFormat | format | ToDate format param. | 
Returns
| Type | Description | 
|---|---|
| DateTime | ToDate returns. | 
decimal ToDecimal<T>(T val)
Converts a value of type T to decimal.
decimal ToDecimal<T>(T val)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| T | val | The value to convert. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal result of the conversion. | 
decimal ToFixedDecimal(decimal num, int digits, int decimals)
Adjusts the digits and decimal positions of a fixed decimal number.
decimal ToFixedDecimal(decimal num, int digits, int decimals)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number to truncate. | 
| Int32 | digits | The desired number of digits. | 
| Int32 | decimals | The desired number of decimal positions. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number adjusted to the given digits and decimal positions. | 
decimal ToFixedDecimal(decimal num, int decimals)
Truncates a decimal to the specified number of decimal positions.
decimal ToFixedDecimal(decimal num, int decimals)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number to truncate. | 
| Int32 | decimals | The desired number of decimal positions. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number adjusted to the given decimal positions. | 
decimal ToFixedDecimalRounded(decimal num, int digits, int decimals)
Adjusts the digits and decimal positions of a fixed decimal number using Away From Zero rounding.
decimal ToFixedDecimalRounded(decimal num, int digits, int decimals)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number to round up. | 
| Int32 | digits | The desired number of digits. | 
| Int32 | decimals | The desired number of decimal positions. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number adjusted to the given digits and decimal positions with rounding. | 
decimal ToFixedDecimalRounded(decimal num, int decimals)
Rounds a decimal to the specified number of decimal positions using Away From Zero rounding.
decimal ToFixedDecimalRounded(decimal num, int decimals)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number to round up. | 
| Int32 | decimals | The desired number of decimal positions. | 
Returns
| Type | Description | 
|---|---|
| Decimal | The decimal number adjusted to the given decimal positions with rounding. | 
string ToStringBinary(decimal num, int digits, int decimals)
Returns as a string the ‘memory’ representation of a binary decimal number.
string ToStringBinary(decimal num, int digits, int decimals)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number to convert. | 
| Int32 | digits | The total number of digits the decimal has. | 
| Int32 | decimals | The number of decimal positions in the decimal number. | 
Returns
| Type | Description | 
|---|---|
| String | The resulting binary decimal representation of the decimal number. | 
string ToStringPacked(decimal num, int digits)
Returns as a string the ‘memory’ representation of a packed decimal number.
string ToStringPacked(decimal num, int digits)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number to convert. | 
| Int32 | digits | The total number of digits the decimal has. | 
Returns
| Type | Description | 
|---|---|
| String | The resulting packed decimal representation of the decimal number. | 
string ToStringZoned(decimal num, int digits, int decimals)
Returns as a string the ‘memory’ representation of a zoned decimal number.
string ToStringZoned(decimal num, int digits, int decimals)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | num | The decimal number to convert. | 
| Int32 | digits | The total number of digits the decimal has. | 
| Int32 | decimals | The number of decimal positions in the decimal number. | 
Returns
| Type | Description | 
|---|---|
| String | The resulting zoned decimal representation of the decimal number. | 
DateTime ToTime(decimal source, DateTimeFormat format)
ToTime summary.
DateTime ToTime(decimal source, DateTimeFormat format)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | source | ToTime source param. | 
| DateTimeFormat | format | ToTime format param. | 
Returns
| Type | Description | 
|---|---|
| DateTime | ToTime returns. | 
DateTime ToTimestamp(decimal source)
ToTimestamp summary.
DateTime ToTimestamp(decimal source)
Parameters
| Type | Parameter name | Description | 
|---|---|---|
| Decimal | source | ToTimestamp source param. | 
Returns
| Type | Description | 
|---|---|
| DateTime | ToTimestamp returns. |