开发者

  in String.Format(...) for currency

I use String.Format to do currency formatting. It works great, but I want a non-breaking space ( ) between the currency symbol (R) and the value so it doesn't wrap in small spaces, making it harder to read.

<%=String.Format("{0:R #,###.00;(R #,###.00);R 0.00}", Model)%>

where Model is a decimal.

How do I add &nbsp; between R and开发者_StackOverflow #,###.00 without confusing the String.Format method?


Would it be possible to wrap the result in an element with the css white-space property set?

<span style="white-space:nowrap;"><%=String.Format("{0:R #,###.00;(R #,###.00);R 0.00}", Model)%></span>


<%=String.Format("{0:R&nbsp;#,###.00;(R&nbsp;#,###.00);R&nbsp;0.00}", Model)%>

No?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜