Reputation: 3395
I have some doubles that I want to format as strings so that they look like this:
$ 123.00
($ 3,231.99)
$ 0.82
So basically I need to get the positive doubles to print with a single trailing space. Here is the string formatted:
Value1.ToString("$ #,0.00 ;($ #,0.00);$ 0.00 ");
However, when they are being printed, on the web page the trailing space is not included. What am I missing?
Upvotes: 1
Views: 273
Reputation: 30813
You need to add the non-breaking space character in your string. To do that, use unicode
\u00A0
Example:
string a = "b\u00A0cd"
Will be printed as:
b cd
Upvotes: 2