Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Proportionnate value..

Former Member
0 Likes
349

Hi experts..

I have one value, which user will enter from interface screen.

I want to divide that value in proportion of the gross weight of selected delivery items.

can u tell me plz..How can i get proportinate value of entered value.

thanks..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
316

Hello

Home task on mathematician ?

Try this logic:

Let we have 5 items with gross weigth:

1 - 10

2 - 20

3 - 30

4 - 40

and user enter value 50 in interface screen.

1. Sum all weigths (102030+40 = 100)

2. Divide value by total (50/100 = 0,5)

3. Multiple result (0,5) by all gross weigth. You will have:

1 - 10 - 5

2 - 20 - 10

3 - 30 - 15

4 - 40 - 20

So, value 50 will be divided pro rata: 5, 10, 15, 20

1 REPLY 1
Read only

Former Member
0 Likes
317

Hello

Home task on mathematician ?

Try this logic:

Let we have 5 items with gross weigth:

1 - 10

2 - 20

3 - 30

4 - 40

and user enter value 50 in interface screen.

1. Sum all weigths (102030+40 = 100)

2. Divide value by total (50/100 = 0,5)

3. Multiple result (0,5) by all gross weigth. You will have:

1 - 10 - 5

2 - 20 - 10

3 - 30 - 15

4 - 40 - 20

So, value 50 will be divided pro rata: 5, 10, 15, 20