Can anyone help me on how to write a numerical field with decimals in cases where this value is less than 1?
DDS DEFINITION
A FIELD084 4S 3 TEXT('DensitaAmbiente')
Example:
C+ Key 'DensitaAmbiente' value P.FIELD084,
If P.Feld084 has the value 1,564, all ok:
"DensitaAmbiente": 1,564,
If P.Feld084 has the value 0.564, Json Format Is Not Correct:
"DensitaAmbiente": .564,
He expects:
"DensitaAmbiente": 0.564,
BR
Giulio Carlomagno
WRITE JSON with EMBEDDED SQL in SQLRPGLE program
-
- Posts: 7
- Joined: Sat Sep 10, 2022 3:59 pm
-
- Posts: 17
- Joined: Wed Jul 28, 2021 11:04 am
- Location: Vermont, USA
- Contact:
Re: WRITE JSON with EMBEDDED SQL in SQLRPGLE program
Hello,
You need to add DECEDIT(0,) to your H-spec or CTL-OPT statement.
https://www.ibm.com/docs/en/i/7.3?topic ... brun-value
Brian
You need to add DECEDIT(0,) to your H-spec or CTL-OPT statement.
https://www.ibm.com/docs/en/i/7.3?topic ... brun-value
Brian
-
- Posts: 7
- Joined: Sat Sep 10, 2022 3:59 pm
Re: WRITE JSON with EMBEDDED SQL in SQLRPGLE program
Hi Brian. I have already added but obtain the same result.
"DensitaAmbiente":.818
"DensitaAmbiente":.818
-
- Posts: 7
- Joined: Sat Sep 10, 2022 3:59 pm
Re: WRITE JSON with EMBEDDED SQL in SQLRPGLE program
Hi all !
I solved.
I solved.
C + KEY 'DensitaAmbiente' value decfloat (P.FIELD084),
I solved.
I solved.
C + KEY 'DensitaAmbiente' value decfloat (P.FIELD084),