Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 outputting a double to n decimal places
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DanielG




PostPosted: Thu Dec 25, 2008 2:30 pm   Post subject: outputting a double to n decimal places

is there any command to do this? or is the only way to write a function specifically for it?
Sponsor
Sponsor
Sponsor
sponsor
SJ




PostPosted: Thu Dec 25, 2008 3:26 pm   Post subject: RE:outputting a double to n decimal places

use printf

http://www.cplusplus.com/reference/clibrary/cstdio/printf.html
wtd




PostPosted: Thu Dec 25, 2008 5:43 pm   Post subject: RE:outputting a double to n decimal places

Using printf is exactly the wrong answer. "printf" is a C function. You're using C++, so you need to be using iostreams and setprecision.
DanielG




PostPosted: Fri Dec 26, 2008 5:01 pm   Post subject: RE:outputting a double to n decimal places

Thanks
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: