I'm using visual studio .net c++ and I'm looking for the easiest code to drop the 0 on 0.233 to .233 when displaying floating point variable on screen. Thanks.
dallin 0 Newbie Poster
Recommended Answers
Jump to PostFor the benifits of others:
You must include <iomanip> to use this manipulator.
// setprecision example #include <iostream> #include <iomanip> using namespace std; int main () { double f =3.14159; cout << setprecision (5) << f << endl; cout << setprecision (9) << f << endl; …
All 3 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.