|
Am I right in assuming you are suggesting that in the calling
program declare a temp field of size of 31, 9. Use this with the
utility function and finally copy the data returned in the temp
field into the real variable ie. A var of size 14, 4 (or any other
size 10, 3 or 7, 4 etc)
For example:
Calling Program:
D answer S 14, 4
D temp S 31, 9
temp = CalculateRate(19.4:3245.5623);
Monitor
answer = temp;
On-Error RESULT_OVERFLOW;
ReportError(Result to Large)
EndMon;
I think that seems to work how I would like. Cheers.
I would be interested to hear what other methods people would
suggest? I'm starting to think if I wanted it to be completely
modular and completely independent of precision and scale (and avoid
temp fields) I would need to declare a standard decimal precision
across the board ie. All decimal variables are declared to be 31, 9
(much like Java/C# etc does in the background with it's standard
variable type anyway). Due to legacy apps this isn't really an
option so I think Chandana's suggestion is a good compromise.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.