Using round()

So i have a program that calculates an equation and my result is for example a decimal number like 15.8569 but its stored into a variable like total, how do i use round() to round it to the second decimal, what i have below is just giving me a straight rounded number in this case 16. and i want to get 15.86

 
  cout << round(result);
#include <iomanip>

cout << std::fixed << std::setprecision(2) << round(result);
is there anyway of doing it without iomanip, or setprecision() ive found tons of information on doing it this way , but our instructor said we shouldn't be using material we haven't learned yet and his instructions dont go much further than "by using round()"
Is there anyway of doing it without iomanip
1
2
3
4
std::cout.setf(std::ios::fixed);
std::cout.precision(2);

std::cout << round(result);

is there anyway of doing it without iomanip, or setprecision() ive found tons of information on doing it this way , but our instructor said we shouldn't be using material we haven't learned yet and his instructions dont go much further than "by using round()"

This requires you to think outside the box a bit.
Hint: Multiply the number in question by 100.
Topic archived. No new replies allowed.