Hi,
I am getting error in formatting string. please help me.
dataTableRow["Amount"] = string.Format("###,###,###.0-", Value[1].ToString());
String.format
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Shweta LodhaRank #31 · 39.8K reputationPosted Jun 19, 2014, 9:43 AM EDT
You missed a small thing:
dataTableRow["Amount"] = string.Format("{0:###,###,###.0-}", Value[1].ToString());
Abhay ShankerRank #375 · 6.7K reputationPosted Jun 19, 2014, 7:07 PM EDT
dataTableRow["Amount"] =String.Format("{0:###,###,###.0-}", Value[1].ToString());
you can also try as below
string.Format("{0:#,###0}", 123456789); // 123,456,789
string.Format("{0:#,###0}", 0); // 0
Shantoh Singh142 reputationPosted Jun 20, 2014, 5:26 AM EDT