Results 1 to 3 of 3

Thread: help with formatting

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2005
    Posts
    38

    help with formatting

    hey all, ok i made a project that calculates the future value of an investment with the given interest, amount n years and i have it all calculated i made a calculate button for it and my future value answer is in a label and the other numbers needed are in text boxes and it all works i get the right answer but i was wonderin how u can make the future value answer be in a dollar format ?

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: help with formatting

    Dim sCurrency As String =FormatCurrency(amount, TriState.True)

    will display with leading currency sign (according to your computor's regional setting) and 000's separators (according to your computor's regional setting)
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Use CultureInfo class to get/specify current locale or use another's culture format . en stands for Language code and US for country .


    visual basic code:


    Dim curInfo AsNew CultureInfo("en-US")

    Dim f AsDecimal = 12354.54

    MessageBox.Show(f.ToString("C", curInfo))



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width