Can I add a final note? We are a banking institution as well and all our numbers are stored as decimal.
For performance and Torrent conversion issues, we do not use Transforms, we use buildops. If we do calculations, we convert temporarily to float and then back to decimal. As a very simple example, this following code converts a percentage interest rate (ex. 22.99%) to a decimal (0.2299).
Code: Select all
APT_DFloat tmpFl = 100.0;
out.int_rt.assignFromDFloat(in.X_NW_DDA_INTEREST_RATE.asDFloat() / tmpFl, APT_Decimal::eRoundInf);
We have float issues as mentioned in this thread, but they went away when we forced rounding. In the buildops there is an enumerated type called RoundMode that can be applied to assignment functions, such as that listed above. The RoundMode is defined as follows (from decimal.h):
Code: Select all
Enumeration for rounding method.
*/
enum RoundMode
{
/**
Discard material to the right of the surviving digit, regardless of
sign. This corresponds to the COBOL INTEGER-PART function.
This is the default rounding mode. Examples: 1.6 -> 1, -1.6 -> -1
*/
eTruncZero,
/**
Round towards nearest representable value, breaking ties by rounding
towards plus infinity (positive) or minus infinity (negative). This
corresponds to the COBOL ROUNDED phrase.
Examples: 1.4 -> 1, 1.5 -> 2, -1.4 -> -1, -1.5 -> -2
*/
eRoundInf,
/**
Truncate towards minus infinity.
This corresponds to the IEEE 754 Round Down mode.
Examples: 1.6 -> 1, -1.4 -> -2
*/
eFloor,
/**
Truncate towards positive infinity.
This corresponds to the IEEE 754 Round Up mode.
Examples: 1.4 -> 2, -1.6 -> -1
*/
eCeil
/* not implemented: IEEE 754 Round to Nearest mode (eRoundEven) */
};
If you are using buildops, you should be able to take advantage of this. Do you know if rounding methods are available in the Transformer? if so, you may want to try that out.
HTH