cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : Printing zero's

Former Member
0 Kudos

Hi,

The value is from RFC x = 1024.34 it is printing same. But in case of x=1024.00(value is from RFC) it is printing only 1024.

I want to print zero's also.

Thanks

Risha

Accepted Solutions (1)

Accepted Solutions (1)

nikhil_bose
Active Contributor
0 Kudos

Sol 1. wdContext.nodeRFC().getNodeInfo().getAttribute("RFCx").getModifiableSimpleType().format("####.00");

Sol 2. Create a Simple Type under dictionary type and put the same format in representation.

Nikhil

Former Member
0 Kudos

Hi,

Thnk you,

Withoout Simpletype how is it possible?

nikhil_bose
Active Contributor
0 Kudos

yes. follow sol 1 in component/cust controller instead of view controller

Former Member
0 Kudos

Hi ,

Thank you verymuch,

how to check the last two decimals are zero's.

Thanks

Risha

nikhil_bose
Active Contributor
0 Kudos

there is no extra coding needed. use the same code in the initialize method.

nodeRFC is RFC is output node

RFC-x is the name of attribute for which the format is needed and is inside nodeRFC.

please try it running and let me know status.

nikhil

Former Member
0 Kudos

Hi ,

I have this RFC value

BigDecimal l_amt = wdContext .nodeDetails().getDetailsElementAt(i).getXYZ();

l_amt = 1024.56 it is printing same.

But l_amt = 1024.00 it is printing l_amt = 1024 only. I want to print same l_amt = 1024.00

thanks

Risha

nikhil_bose
Active Contributor
0 Kudos

is this printed using MessageManager? anyway try l_amt.doubleValue()

Plz try to report using UI elements.

Edited by: Nikhil ßos on Nov 14, 2008 11:28 AM

Former Member
0 Kudos

>

> Hi ,

>

> Thank you verymuch,

> how to check the last two decimals are zero's.

>

> Thanks

> Risha

Hi Risha,

Please check your other post.

Regards,

Anagha

Former Member
0 Kudos

HI,

DecimalFormat d = new DecimalFormat("####.##");

String value = wdContext .nodeDetails().getDetailsElementAt(i).getXYZ();

Regards,

Murtuza

nikhil_bose
Active Contributor
0 Kudos

Thats good Murtuza. Thanks. I am changing the code bit.


DecimalFormat df = new DecimalFormat("####.00");
BigDecimal l_amt = wdContext .nodeDetails().getDetailsElementAt(i).getXYZ();
String result = df.format(l_amt.doubleValue());

plz close thread if answered.

Nikhil

Answers (0)