-2

Running query from Java code no chance to change the global preferences. I have to print 123.34 as 123.3400000000000 ie. with 13 digits after the decimal point without losing any values

CAST(SUM(F.TOTAL_DOCUMENT_CHARS) AS DECIMAL(18,0))/1000 AS "DOC CHARS"

by changing global preferences to default format getting 14891.4530000000000, without that as well I need to get

Expected output : 123.3400000000000

Nakilon
  • 34,866
  • 14
  • 107
  • 142
  • DECIMAL(18,0) ... it means value of 18 numbers and 0 decimal spaces ... in your case i guess you need decimal(18,13) .. – Veljko89 Mar 04 '16 at 09:28
  • `CAST(SUM(F.TOTAL_DOCUMENT_CHARS)/1000.0 AS DECIMAL(18,13))`? – jarlh Mar 04 '16 at 09:32
  • [Check this answer ( if it is java )...](http://stackoverflow.com/questions/5195837/format-float-to-n-decimal-places) – hephestos Mar 04 '16 at 13:33

1 Answers1

0

declare the variable as decimal(5,13) if you desire the length to remain as 18.