cancel
Showing results for 
Search instead for 
Did you mean: 

Trimming leading zeroes

Former Member
0 Kudos

Hi,

In my webdynpro application, table data is getting displayed from BAPI. In one particular column, the

price value is having leading zeroes when i am checking in R3 infotype. The leading zeroes are not

getting displayed in Webdynpro screen but it's taking space in that particular column.

In this case if i have to trim these leading zeroes from that column, how to do that.

Thanks a lot.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Make a similar context node in the context, just map the UI to that node and while copying the values from orignal node to another node change the format as you want like

DecimalFormat df2 = new DecimalFormat( "#,###,###,##0.00" );

double dd = 1234.432;

System.out.println(df2.format(dd)); // Will print 1,234.43 if commas are needed change the format accordingly

dd = 3456.45678;

System.out.println(df2.format(dd));// output 3,456.46

Regards

Raghu

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Srini,

While getting the values from backend, use trim() function, it eliminates both leading and trailing zeroes

This will surely work.

Regards,

Nikhil