Два десятичных знака с использованием c #

decimal Debitvalue = 1156.547m;

decimal DEBITAMT = Convert.ToDecimal(string.Format("{0:0.00}", Debitvalue));

Error: User Rate Limit Exceeded

Ответы на вопрос(10)

Error: User Rate Limit ExceededStringError: User Rate Limit Exceeded

double value = 123.456789;
String.Format("{0:0.00}", value);

Error: User Rate Limit ExceededSystem.Math.RoundError: User Rate Limit Exceeded

double value = 123.456789;
System.Math.Round(value, 2);

Error: User Rate Limit Exceeded

yournumber.ToString("0.00");

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededMath.Round()Error: User Rate Limit Exceeded

decimal DEBITAMT = Math.Round(1156.547m, 2);

I use

decimal Debitvalue = 1156.547m;
decimal DEBITAMT = Convert.ToDecimal(string.Format("{0:F2}", Debitvalue));

Error: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

String.Format("{0:.##}", Debitvalue)

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

String.Format("{0:C}", Debitvalue)

Error: User Rate Limit Exceeded

decimal decimalRounded = Decimal.Parse(Debitvalue.ToString("0.00"));
Решение Вопроса

Error: User Rate Limit ExceededMath.Round()

Ваш ответ на вопрос