c++ - Set Precision for double -
I am trying to set the number two decimal numbers for the user to double type of data, and I have an appropriate header file But the result of the demonstration is only integer, not a decimal? I really appreciate any help
You want to use the following format.
cout & lt; & Lt; Set CPC (# of last decimal places) & lt; & Lt; Fixed & lt; & Lt; VarName & lt; & Lt; Endl; There is a fixed input output manipulator which tells you that you are determining the accuracy for the number of locations after the decimal point.
Comments
Post a Comment