precision in f

This is a discussion on precision in f within the C Programming forums, part of the General Programming Boards category; How do I get 2 decimal places precision using the "%f" ?? is it just by "%2f"?? I tried this ...

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    569

    precision in f

    How do I get 2 decimal places precision using the "%f" ?? is it just by "%2f"?? I tried this but it fails...

  2. #2
    Registered User
    Join Date
    Nov 2006
    Location
    japan
    Posts
    126
    try "%.2f"
    Mac OS 10.6 Snow Leopard : Darwin

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Setting Precision Confusion
    By dnguyen1022 in forum C++ Programming
    Replies: 11
    Last Post: 01-14-2009, 10:38 AM
  2. Format Precision & Scale
    By mattnewtoc in forum C Programming
    Replies: 1
    Last Post: 09-16-2008, 11:34 AM
  3. Replies: 1
    Last Post: 04-03-2008, 02:17 AM
  4. Precision based floating-point
    By Mario F. in forum C++ Programming
    Replies: 4
    Last Post: 07-17-2006, 11:35 AM
  5. International Limits on Precision
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-20-2004, 07:32 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21