回合100.11至100.15和100.16至100.20的C#回合100.11至100.15和100.16至100.20的C#
我已經嘗試了所有這些事情,但沒有這些幫助我。
Math.Round(100.11, 2,MidpointRounding.AwayFromZero); //gives 100.11
Math.Round(100.11, 2,MidpointRounding.ToEven);//gives 100.11
Math.Round((Decimal)100.11, 2)//gives 100.11
(100.11).ToString("N2"); //gives "100.11"
Math.Floor(100.11);// gives 100.0
(100.11).ToString("#.##");//gives "100.11"
Math.Truncate(100.11);// gives 100.0
Math.Ceiling(100.11);//gives 101.0
(100.11).ToString("F4");// gives "100.1100"
你試過'Math.Round(100.11,0)'嗎? – MusicLovingIndianGirl
100.11至100.15 ??你的意思是100.10嗎? –
@ Aishvarya Math.Round(100.11,0); 100.0 –