1. Member
Join Date
Jan 2014
Posts
3
Rep Power
0

Hi ,
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);
}
}

Thank you so much !

2. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,226
Rep Power
14

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

3. Member
Join Date
Jan 2014
Posts
3
Rep Power
0

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!!!

4. Member
Join Date
Jan 2014
Posts
3
Rep Power
0

Something like this ( but correct :)) :

if(results[i].getSite()=='Xxx'&&XPrice==0)
{
XPrice =(results[i].getPrice() x% + y% + 5\$ );
}
}

5. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
6,226
Rep Power
14

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.
Java Code:
`XPrice =(results[i].getPrice() x% + y% + 5\$ );`
Regards,
Jim

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•