Please help - calc percent in java

Hi ,

Please help me with this problem :

I whoul like to change the precent from *1.17 (17%) to calc of precent like this :

3% + 5% + 5$

For example :

The resault is 10$ - i want to get :

10$ +3%(0.3$) + 0.5% (0.51$) + 5$ = **15.81$**

How i change this line to this calc

if(results[i].getSite()=='Xxx'&&XPrice==0)

{

**XPrice =(results[i].getPrice() *1.17); **

}

}

Please help me with this is very iportant to me

Thank you so much ! :D:

Re: Please help - calc percent in java

First, check your percentages. 3% is 3/100 or .03 and 5% is 5/100 or .05. It sounds like you want 17% of 10 to be the same as some x% of 10 + y% of 10 + 5. But that makes x and y arbitrary values and they could be anything. So I am not really certain what you are asking for.

Regards,

Jim

Re: Please help - calc percent in java

Thanks for reply ,

Let me explain please :

run a search and this code The result is multiplied in this case by 17% (1.17 *)

I do not want the result will be multipliedbut rather I want result has to be calculated like this:

X% + Y% + Z $.

Is it possible? If yes how it will look in the code?

Thank you!!!

Re: Please help - calc percent in java

Something like this ( but correct :)) :

if(results[i].getSite()=='Xxx'&&XPrice==0)

{

XPrice =(results[i].getPrice() x% + y% + 5$ );

}

}

Re: Please help - calc percent in java

Even if you fix the value of Z, the values of X and Y can take on many different values and still get the same result. So either I am not understanding something or you need to provide more information. And the following syntax does not make sense to me.

Code:

`XPrice =(results[i].getPrice() x% + y% + 5$ );`

Regards,

Jim