2 Replies - 979 Views - Last Post: 02 April 2013 - 07:31 AM Rate Topic: -----

#1 acProgrammer  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 20
  • Joined: 23-March 13

c# string - need to format like currency

Posted 01 April 2013 - 07:02 PM

Newby here again - I am creating a program to diplay a string but can't figure out how to successfully get it to diplay the variable pennyInteger as currency. I don't have my book with me & am having no success googling. Guessing this is extremely simple to everyone else...

    dispMsgString = string.Format("On day " + dayInteger + " you have " + pennyInteger);
    this.dispListBox.Items.Add(dispMsgString);



Thanks again

This post has been edited by GunnerInc: 01 April 2013 - 07:54 PM
Reason for edit:: Fixed code tags


Is This A Good Question/Topic? 0
  • +

Replies To: c# string - need to format like currency

#2 ThrowsException  Icon User is offline

  • D.I.C Head

Reputation: 33
  • View blog
  • Posts: 83
  • Joined: 21-February 12

Re: c# string - need to format like currency

Posted 01 April 2013 - 08:03 PM

http://msdn.microsof...(v=vs.110).aspx
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5540
  • View blog
  • Posts: 11,868
  • Joined: 02-June 10

Re: c# string - need to format like currency

Posted 02 April 2013 - 07:31 AM

The definitive page on string.format codes:
http://blog.stevex.n...ting-in-csharp/
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1