Right aligned output text - Hierarchical map EDI to Text

Five Stars

Right aligned output text - Hierarchical map EDI to Text

Hi,

 

I am developing hierarchical map for EDI to Text -

Few of the output fields expect right aligned output as shown below. you can see 325.610, 35.470 etc are right aligned in the output.

 

Can you please let me know how to right align them ?

 

NP25         325.610 TIM USD
NP25         353.470 TIM USD
NP25         244.340 TIM USD
NP25          32.730 TIM USD

 

Regards

Sixteen Stars TRF
Sixteen Stars

Re: Right aligned output text - Hierarchical map EDI to Text

Suppose you're expecting 4 digits for the left side and 3 for the right side, you can use the following code in a tJavaRow component:

DecimalFormat df1 = new DecimalFormat("###0.000");
output_row.price = df1.format(input_row.price);

 


TRF

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog