for example,
70.50 % = 71%
70.20 % = 70 %
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 29, 2013, 4:33 AM EDT
Try like this
string data="70.50%";
string tempdata=data.Replace("%","");
double d=Math.Round(Convert.ToDouble(tempdata),2);
string result=d.ToString()+"%";
Regards,
Iftikar
VulpesRank #55 · 29.2K reputationPosted Aug 29, 2013, 5:15 AM EDT