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 {0: 0,0}

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.

  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.  

The main advantage above any custom format string is that it automatically adjusts culture variations in client-side.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -