Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > currency format

Reply
Thread Tools

currency format

 
 
Mike
Guest
Posts: n/a
 
      02-14-2008
I have to format a number in currency format but I don't want the decimals.

I want it to look like

$4545

and not

$4545.60

I have this for my format:
dr["GrossExpense"] = Convert.ToInt32(GrossAmount).ToString("c");

but its displaying as $4545.60. How can I get it to show without the
decimals (.60)?




 
Reply With Quote
 
 
 
 
Mike
Guest
Posts: n/a
 
      02-14-2008
I figured it out.

I have to use
dr["GrossExpense"] = Convert.ToInt32(GrossAmount).ToString("c0");


"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have to format a number in currency format but I don't want the decimals.
>
> I want it to look like
>
> $4545
>
> and not
>
> $4545.60
>
> I have this for my format:
> dr["GrossExpense"] = Convert.ToInt32(GrossAmount).ToString("c");
>
> but its displaying as $4545.60. How can I get it to show without the
> decimals (.60)?
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I Format Currency w/out decimals? JeffP@Laptop ASP .Net 3 12-15-2005 02:06 AM
Format Currency for label VB Programmer ASP .Net 2 09-14-2005 02:35 PM
Format DataItem 'inline' as Currency/String? D. Shane Fowlkes ASP .Net 1 06-09-2005 04:05 PM
convert output to currency format TJS ASP .Net 0 05-18-2005 09:04 PM
CompareValidator on currency figure in French format Biao Tang ASP .Net 0 04-28-2005 09:15 AM



Advertisments