How to add £ and comma to an amount?

Viewed 49

I have the following strings

string a = "1000" string b = "£1,000".

I am doing an Assert.Equal to try and compare the two strings but I need to format one of them to be exactly the same as the other.

I have looked at numerous StackOverflow posts and none have exactly what I require.

I have tried the following:

string getAmount = "1000"

string myStrong = String.Format("{0:#,###.##", getAmount)

but it doesn't work, I get "Input string was not in a correct format" Can anyone help?

Thanks

0 Answers
Related