Focal Point
[CLOSED] Decimal Value automatically round off

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3297062886

November 08, 2017, 12:02 PM
PriyaBilly
[CLOSED] Decimal Value automatically round off
SQL SQLORA
select
'PRNT' AS "ORDER_TYPE",
DECODE(nvl(0,0),0,nvl(.135,0)*1,1,nvl(.135,0)*(-1)) AS "LIMIT_PR"
FROM
DUAL

UNION ALL

select
'CHILD' AS "ORDER_TYPE",
DECODE(nvl(0,0),0,nvl(.135,0)*1,1,nvl(.135,0)*(-1)) AS "LIMIT_PR"
FROM
DUAL

UNION ALL

select
'EXEC' AS "ORDER_TYPE",
NULL AS "LIMIT_PR"
FROM
DUAL

UNION ALL

select
'PRNT-TOTAL' AS "ORDER_TYPE",
NULL AS "LIMIT_PR"
FROM
DUAL
SQL SQLORA END SESSION;

TABLE FILE SQLOUT
PRINT
*
ON TABLE PCHOLD FORMAT EXL2K
END

While i execute the code ,if i run only the PRNT and CHILD union i get the value of LIMIT_PR is .135
But when i union with EXEC and PRNT-TOTAL with NULL it gives as .14
EXEC and PRNT-TOTAL should be NULL

But I need exact result .135 without round off
Please advise.

This message has been edited. Last edited by: FP Mod Chuck,


webfocus 8105,Windows 7 Enterprise
November 09, 2017, 07:59 AM
Dave
First,

I don't think it a WebFocus issue.

The NULL AS "LIMIT_PR" has no format, looks like it chooses default something with two decimals.

Either fix that or...

Why not 0.000 AS "LIMIT_PR"?

And add a define to the SQLOUT

DEFINE FILE SQLOUT
   REAL_VALUE/D12.3 MISSING ON = IF ORDER_TYPE EQ 'EXEC' OR 'PRNT-TOTAL' THEN MISSING ELSE LIMIT_PR;
END


Should do the trick.


_____________________
WF: 8.0.0.9 > going 8.2.0.5