 # Breaking down value and return the result in a gridview[Answered] RSS

## 2 replies

Last post Jul 25, 2016 03:02 PM by Chris Zhao

• ### Breaking down value and return the result in a gridview

Good day team of developers,

Please can anyone help to solve this problem. I have a value of 30000 and i want to calculate 10% of this value to 3 times and balance will be returned at the fourth. Find below what i mean

10% of 30000 = 3000  the value of 30000 reduce to 27000. The value of 3000 returns in a gridview

10% of 27000= 2700 the value of 27000 reduce to 24300. The value of 2700 returns in the same gridview.

10% of 24300 = 2430 the value of 24300 reduces to 21870. The value of 2430 is also returns in the same gridview.

finally my gridveiw will look like this

s#           value

1              3000

2              2700

3              2430

4             21870

The last record will return the balance after 3 times of return. Also The summation of breakdown must be equal to actual value which is 30000.

Thank You

• ### Re: Breaking down value and return the result in a gridview

```var x = 30000;
var i = 0.10*x;
var j = 0.10*(x-i);
var k = 0.10 * (j-(i+j));
var r = x-(i+j+k);```

• ### Re: Breaking down value and return the result in a gridview

Jul 25, 2016 03:02 PM|Chris Zhao|LINK

Hi moruff,

Try

```var value = 30000;
var n = 3;
var r = 0;
var p = (int)(value * Math.Pow(0.9, n));

var values = new List<int>();
for (int i = 1; i <= n; i++)
{
r = value * 10 / 100;