[CLOSED] Dialogue Manager - Larger number calculations
I am trying to do some calculations with some amper values that I receive. Every thing works fine till I come across large numbers, here is an example below. The result gives me ***'s. Please advice.
-SET &ECHO=ALL; SET DMPRECISION = 2 -SET &TR_VAL_M1 = 129391830.37 - 6469591.52 ; -TYPE &TR_VAL_M1 -EXITThis message has been edited. Last edited by: Kerry,
WF: 7.6.8 OS/Platform: Windows, Unix
February 21, 2011, 04:06 PM
Waz
Looks like you have hit a limit.
You may have to ask IBI about this.
Why do you need to do calcs on large numbers with DM ?
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
February 22, 2011, 03:47 AM
Alan B
It seems as though calculations within DM are limited. However help is always at hand with the DEFINE FUNCTION:
-SET &ECHO=ALL;
SET DMPRECISION = 2
DEFINE FUNCTION SUB(operand/D20.2,subtractor/D20.2)
SUB/A20 =FTOA(operand-subtractor,'(D20.2c)','A20');
END
-RUN
-SET &TR_VAL_M1 = SUB(12345678901234567.12, 1234567.12) ;
-TYPE &TR_VAL_M1
-EXIT
which will handle larger numbers.
Alan. WF 7.705/8.007
February 22, 2011, 03:32 PM
Waz
Awesome, Alan.
I keep forgetting you can use define functions with DM.