dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Convert to price value

  1. #1
    Join Date
    Mar 2012
    Posts
    13

    Convert to price value

    Hallo my question is lets say i have 4*0.8 that is equal to 3.2 but i want the pc to understand that this is a price and it should be written 3.20 euro for example not 3.2 euro

  2. #2
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,019

    Re: Convert to price value

    Print as %.2f if it is a float or %.2lf if it is a double
    Succinct is verbose for terse

  3. #3
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Convert to price value

    For C++ way (using streams) please see here.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)