none
Limiting the decimal Places RRS feed

  • Question

  • Is there a way to limit the decimal places to just 2? 

    /*Set the variable to 0 */
    _bmiVal = 0;
    /*Equation*/
    _bmiVal = (_weight / Math.Pow(_inchesVal + _heightVal * 12, 
    2)) * 703;
    /*Place the answer in the WPF text box as a string*/
    txtBMI.Text = _bmiVal.ToString();

    Saturday, April 20, 2019 2:44 PM

All replies