Check out example codes for "calculated field gridview asp.net". It will help you in understanding the concepts better.

Code Example 1

protected decimal Calculate(string a, string b)
{
    decimal ad = Convert.ToDecimal(a);
    decimal bd = Convert.ToDecimal(bd);

    if (bd == 0)
    {
        return 0; // or whatever
    }

    return ad / bd;
}

Code Example 2

<asp:Label ID="lblCalc" runat="server" >
    <%# Calculate(Eval("val1").ToString(), Eval("val2").ToString()) %>
</Label>

Learn ReactJs, React Native from akashmittal.com