Hi
I must sum calculated ratio values to the given amount of 2000.
Instead I get a sum not equal to 2000.
I know this has to do with the error in rounding.
How can I manage the rounding to sum to exactly 2000
Here is what I did so far:
**
Private Sub btnLoad_Click(sender As System.Object, e As System.EventArgs) Handles btnLoad.Click
If IsNumeric(txtAmt.Text) And dgv.Rows.Count > 0 Then
For i As Integer = 0 To dgv.Rows.Count - 1
dgv.Rows(i).Cells("CalculatedRatioVal").Value = Math.Round(CInt(dgv.Rows(i).Cells("rubVal").Value) * CInt(txtAmt.Text) / 2950, 2)
Next
End If
End Sub**
Thanks