could somebody please give me a clue as to how I can reduce the number of digits from a float when giving a write out command i.e. for a float that gives currency as an answer?
any floating point output will show to 2 digits of precision.
you have to include iomanip.h for setprecision to work
the first 2 lines are taken care of by the ios class which is a base class of iostream.h used for i/o in c++
Try "The complete reference" c++ which gives idea about
the formatting of the float,string and much more.If u want u can also download the programs from the net
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.