mono-api-decimal.html
Decimal Support
You can use the mono_decimal functions to access and
manipulate System.Decimal types from C.
mono_decimal2double
Prototype: mono_decimal2double
mono_decimal2Int64
gint32 mono_decimal2Int64(/*[In]*/decimal_repr* pA, gint64* pResult)
Parameters
pA:pResult:
Remarks
converts a decimal to an Int64 without rounding
mono_decimal2string
gint32 mono_decimal2string(/*[In]*/decimal_repr* pA, gint32 digits, gint32 decimals,
MonoArray* pArray, gint32 bufSize, gint32* pDecPos, gint32* pSign)
Remarks
@
returns minimal number of digit string to represent decimal
No leading or trailing zeros !
Examples:
*pA == 0 => buf = "", *pDecPos = 1, *pSign = 0
*pA == 12.34 => buf = "1234", *pDecPos = 2, *pSign = 0
*pA == -1000.0000 => buf = "1", *pDecPos = 4, *pSign = 1
*pA == -0.00000076 => buf = "76", *pDecPos = -6, *pSign = 0
Parameters:
pA decimal instance to convert
digits 0: gets at most
digits, rounded according to banker's rule if necessary
decimals only used if digits = 0: number of decimal places
buf pointer to result buffer
bufSize size of buffer
pDecPos receives insert position of decimal point relative to start of buffer
pSign receives sign
mono_decimal2UInt64
gint32 mono_decimal2UInt64(/*[In]*/decimal_repr* pA, guint64* pResult)
Remarks
pA
pResult
converts a decimal to an UInt64 without rounding
mono_decimalCompare
Prototype: mono_decimalCompare
mono_decimalDiv
Prototype: mono_decimalDiv
mono_decimalFloorAndTrunc
Prototype: mono_decimalFloorAndTrunc
mono_decimalIncr
Prototype: mono_decimalIncr
mono_decimalIntDiv
Prototype: mono_decimalIntDiv
mono_decimalMult
Prototype: mono_decimalMult
mono_decimalRound
Prototype: mono_decimalRound
mono_decimalSetExponent
Prototype: mono_decimalSetExponent
mono_double2decimal
Prototype: mono_double2decimal