Floating point number

This is a discussion on Floating point number within the C Programming forums, part of the General Programming Boards category; How can i limit a floating point number to 2 decimal places?...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    5

    Floating point number

    How can i limit a floating point number to 2 decimal places?

  2. #2
    Bond sunnypalsingh's Avatar
    Join Date
    Oct 2005
    Posts
    162
    printf("%.2f",floatingpointnumber);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. floating point number printf/string formating
    By stanlvw in forum C++ Programming
    Replies: 2
    Last Post: 04-22-2009, 05:41 PM
  2. Testing Floating Point Return Values
    By jason_m in forum C Programming
    Replies: 5
    Last Post: 08-15-2008, 02:37 PM
  3. Decimal places on Floating point number
    By manutdfan in forum C Programming
    Replies: 1
    Last Post: 10-29-2006, 12:56 PM
  4. floating point variables in edittext controls
    By dootickle in forum Windows Programming
    Replies: 3
    Last Post: 04-15-2004, 12:15 PM

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