DataFormatString Question #2 Forcing Currency Format

  • Thread starter Thread starter Phillip Vong
  • Start date Start date
P

Phillip Vong

VS2005 and SQL2000

Have a column with Data Type "Float". Example, the value in the row could be
80025.36958
or
123.5
etc.

Using a Gridview, I want to force this column to return as currency.

1) I've tried {0:c}
This does absolutely nothing. Returns all the number as is.

2) I forced it to ruturn with ${0:c2}.
This will return the numbers with $ but does not round to 0.XX and if a
number does not have 0.XX like 123.5, then I only get $123.5 and I want to
get $123.50. Also, the 80025.36958 example from above returns as
$80025.336958. I want to make it seperate the thousands by comma. Basically,
I'm looking for the standard format of $80,025.37.

Can someone help?

Thanks!

Phil
 
Mark,
Thanks for the reply, but that did not help at all. I'm still getting
results like 80025.336958.

Someone Please help. I'm doing this in VS2005.
 
Mark, Thanks! You actually solved my problem by reminding me to make
HtmlEncode="False". I just left the format as {0:c} and everything worked.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top