Displaying decimal numbers in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mickey22
    New Member
    • Feb 2007
    • 105

    Displaying decimal numbers in C++

    Hi all,

    I want to specify a limit of numbers to be printed after the decimal point .Could anyone tell me what to use in vc++ ?

    eg: 5.3446785

    I want to print just 5.34467

    Thanks.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Check out cout.precision( ).

    Comment

    Working...