when I get the value from the database, if the database value is "999999", the TextBox will display null; if the database value is "456", then the TextBox will display 4.56".
That is the function:
Code:
public static string TotalBaselineMaximum(string MaximumAMT)
{
string tmpMaximumAMT = "";
if (MaximumAMT == "")
tmpMaximumAMT = "999999";
else if (MaximumAMT == "999999" || MaximumAMT == "0")
tmpMaximumAMT = "";
else
{
decimal dec;
dec = Convert.ToDecimal(MaximumAMT);
if (MaximumAMT.Contains("."))
tmpMaximumAMT = Math.Round(dec * 100).ToString();
else
tmpMaximumAMT = (dec / 100).ToString();
}
return tmpMaximumAMT;
}
No comments:
Post a Comment