0

I am formatting a gridview templatefield that is databound with{0:c} and it displays currency as such:

$790.00

Is there a way to adjust it so the dollar symbol isn't displayed?

developthestars
  • 185
  • 1
  • 12
  • 27

2 Answers2

1

You simply need to change your format specifier to 'f'. Here's an example:

    double foo = 790f;
    string bar = string.Format("{0:f}", foo);

Output

790.00

Shame on you for not looking this up :D

See this article for details on numeric formatting: Standard Numeric Format Strings

Jeremy
  • 8,902
  • 2
  • 36
  • 44
0
string foo="$790"
string blahblah=foo.replace("$","");
TextBox1.Text=blahblah;

output=790

:)

writeToBhuwan
  • 3,233
  • 11
  • 39
  • 67