c# - Format a string using binding to format currency with no decimal places -
$ 1200
Em
However, I could not find any way to do this.
I got the answer that gives me
1,200 using But there is no dollar sign in front of it. What should I do to accomplish this by using a stringing firm member of the binding. If I understand your requirement correctly, you can use it only It is the second in the examples which links. The main advantage above any custom format string is that it automatically adjusts culture variations in client-side. {0: 0,0}
decimal a = 1200; Return a.ToString ("C"); // or string.Format ("{0: c}", a); You can also use
"C0" if you do not really want to represent any decimal place.
Comments
Post a Comment