
-----------------------------------
DanielG
Thu Dec 25, 2008 2:30 pm

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?

-----------------------------------
SJ
Thu Dec 25, 2008 3:26 pm

RE:outputting a double to n decimal places
-----------------------------------
use printf

http://www.cplusplus.com/reference/clibrary/cstdio/printf.html

-----------------------------------
wtd
Thu Dec 25, 2008 5:43 pm

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
Fri Dec 26, 2008 5:01 pm

RE:outputting a double to n decimal places
-----------------------------------
Thanks
