cancel
Showing results for 
Search instead for 
Did you mean: 

adding quantites

Former Member
0 Kudos

Hi,

I am getting following values against quantity:

100.000

200.000

I need result as

300.000

But I am getting result as

300.0

Please let me know the process to get the proper format in result...

Basha.

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Are you talking about mapping?

Then you can use arithmetic function "FormatNum"

Former Member
0 Kudos

Thanks for the reply Stefen...

I cann't use FormatNumber becuase I don't know exact length of the target filed. for example if I use 00000.000 then my output is adding two zeros preceding like 00310.000. It should be 310.000 not 00310.000.

So please provide some UDF for this requirement.

I am using the following UDF...eventhough my result is not adding 000 as decimals...

double sum = 0;

double result1 = 0;

for(int i=0;i<value.length;i++){

sum = sum+Double.valueOf(value<i>);

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

result1 = Double.valueOf(df.format(sum));

}

result.addValue(result1);

sbuttler77
Active Participant
0 Kudos

you can use FormatNum like this .000. It will only add zeros after the period.

stefan_grube
Active Contributor
0 Kudos

you can put ######0.000

that would help

Answers (0)