C# percentage is 0

前端 未结 6 1203
囚心锁ツ
囚心锁ツ 2021-01-22 08:35

I have a problem when I try to solve simple equation. My equation is find the percentage of student marks. This is my code:

using System;
using System.Collection         


        
6条回答
  •  情歌与酒
    2021-01-22 09:14

    try this:

    private void button1_Click(object sender, EventArgs e)
            {
                decimal oneee = 300;
                decimal two = 1000;
                decimal thee = 10;
                decimal aResult = (oneee / two) * 10;
                label1.Text = aResult.ToString("0.00");
            }
    

提交回复
热议问题