• 0

setprecision?


Question

In this code:

void secs(double& seconds, int milliseconds, int& hours, int& minutes)

{
seconds = (milliseconds / 1000) - (hours * 3600) - (minutes * 60);
}

void time(int& milliseconds, int &hours, double &seconds, int &minutes)

{
hrs(hours, milliseconds);
mins(minutes, milliseconds, hours);
secs(seconds, milliseconds, hours, minutes);
}

I wish to output seconds as a double with 3 decimal places. I know what setprecision does, I'm just confused with where to put it...

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.