FixedDecimal struct | QSYS API Reference Guide
Estimated reading time: 3 minutes
Holds a fixed-decimal value with the specified number of digits and decimal positions.
Namespace: ASNA.QSys.Runtime Assembly: ASNA.QSys.Runtime.dll
Properties
Type | Name | Description |
---|---|---|
Int32 | Decimals | Gets the number of decimal positions in this FixedDecimal number. |
Int32 | Digits | Gets the number of digits in this FixedDecimal number. |
Int32 | Length | Gets the length of this FixedDecimal. |
Decimal | Value | Gets the value of this FixedDecimal as a decimal. |
Object | ValueAsObject | Gets the value of this FixedDecimal as an object. |
Methods
Signature | Description |
---|---|
CompareTo(Object) | Compare to object. |
Convert(Decimal) | Convert to IFixedSizeType. |
Equals(Object) | Determines whether two FixedDecimals have the same value. |
GetHashCode() | Returns the hash code for this instance. |
MergeLeft(String, Boolean) | Merge left. |
MergeRight(String, Boolean) | Merge right. |
ToPackedRepresentation() | Convert this FixedDecimal to its packed representation. |
ToString() | Convert to string. |
int CompareTo(object obj)
Compare to object.
int CompareTo(object obj)
Parameters
Type | Parameter name | Description |
---|---|---|
Object | obj | The object to compare against. |
Returns
Type | Description |
---|---|
Int32 | A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the obj parameter. |
IFixedSizeType<decimal> Convert(decimal value)
Convert to IFixedSizeType.
IFixedSizeType<decimal> Convert(decimal value)
Parameters
Type | Parameter name | Description |
---|---|---|
Decimal | value | The value to convert. |
Returns
Type | Description |
---|---|
IFixedSizeType`1 | The resulting IFixedSizeType. |
bool Equals(object obj)
Determines whether two FixedDecimals have the same value.
bool Equals(object obj)
Parameters
Type | Parameter name | Description |
---|---|---|
Object | obj | Object to test. |
Returns
Type | Description |
---|---|
Boolean | true if the value of the value parameter is the same as this string; otherwise, false. |
int GetHashCode()
Returns the hash code for this instance.
int GetHashCode()
FixedDecimal<TDigits, TDecimals> MergeLeft(string s, bool pad)
Merge left.
FixedDecimal<TDigits, TDecimals> MergeLeft(string s, bool pad)
Parameters
Type | Parameter name | Description |
---|---|---|
String | s | Input string. |
Boolean | pad | True is padding with zeroes. Default is false. |
Returns
Type | Description |
---|---|
FixedDecimal`2 | The FixedDecimal result. |
FixedDecimal<TDigits, TDecimals> MergeRight(string s, bool pad)
Merge right.
FixedDecimal<TDigits, TDecimals> MergeRight(string s, bool pad)
Parameters
Type | Parameter name | Description |
---|---|---|
String | s | Input string. |
Boolean | pad | True if padding with zeroes. Default is false. |
Returns
Type | Description |
---|---|
FixedDecimal`2 | The FixedDecimal result. |
string ToPackedRepresentation()
Convert this FixedDecimal to its packed representation.
string ToPackedRepresentation()
string ToString()
Convert to string.
string ToString()