How do you round a number to two decimal places in C#?

后端 未结 15 1035
挽巷
挽巷 2020-11-22 08:59

I want to do this using the Math.Round function

15条回答
  •  无人及你
    2020-11-22 09:48

    This is for rounding to 2 decimal places in C#:

    label8.Text = valor_cuota .ToString("N2") ;
    

    In VB.NET:

     Imports System.Math
     round(label8.text,2)
    

提交回复
热议问题