Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
RVeitch_84
Creator
Creator

Format a BigDecimal to 2 digits with globalMap.

I'm trying to format a Big Decimal to two digits so I can use PUT and GET.

My data in the flow for file_amt is : 170695.00

Here is my tJavaRow.

BigDecimal file_amt ;

file_amt = output_row.f_amount ;

globalMap.put("file_amt",file_amt);

System.out.println("file_amt from GV = " + (BigDecimal)globalMap.get("file_amt") );

But as soon as I do a

globalMap.get

the format has changed to : 170695

Labels (4)
1 Reply
gjeremy1617088143

Hi, could you try to use tRowGenerator with one column as Bigdecimal with the lenght and the precision you want and in the value you set (BigDecimal)globalMap.get("file_amt") ). Normally you will see 170695.00 if you link a tlogrow .

Also in your println you do a concatenation maybe the problem is here

maybe you could try System.out.println("file_amt from GV = " + String.valueOf((BigDecimal)globalMap.get("file_amt") ));

Send me love and kudos