hi, i am writing a program that keeps track of the money in my debit card account. i need the program to be able to pull out a value (such as 1.56356) from a text file, round it to the nearest hundredth, and put it back into the file. any solutions?
thecoolman5
8
Posting Whiz in Training
Recommended Answers
Jump to PostAll you need is to rewrite the value with 2 digit precision after the dot.
Look at setprecision. There are examples that do exactly what you need.
Just read the numbers from the input file, and write them to the output file with the setprecision …
All 4 Replies
m4ster_r0shi
142
Posting Whiz in Training
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
thecoolman5
8
Posting Whiz in Training
m4ster_r0shi
142
Posting Whiz in Training
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.