src/pathfinder.cpp
void PathFinder::printTimeDuration(std::ostream& ostr, const double& timedur) const
    {
        int hours = static_cast<int>(timedur/60.0);
        double minutes = timedur - 60.0*hours;
        double minpart, secpart;
        secpart = modf(minutes, &minpart);
        secpart = secpart*60.0;
        // double intpart, fracpart;
        // fracpart = modf(secpart, &intpart);
        ostr << std::right;
        ostr << std::setw( 2) << std::setfill(' ') << std::right << hours << ":"; // hours
        ostr << std::setw( 2) << std::setfill('0') << static_cast<int>(minpart)      << ":"; // minutes
        int width = 3;
        if (secpart < 9.95) { ostr << "0"; width = 2; }
        ostr << std::left << std::setw(width) << std::setprecision( 1) << std::fixed << std::setfill(' ') << secpart << std::right; // seconds
    }
/*
     * Assuming that timedur is duration in minutes, prints a formatted version.
     */
Assuming that timedur is duration in minutes, prints a formatted version.
Assuming that timedur is duration in minutes prints a formatted version .
void PathFinder::printTimeDuration(std::ostream& ostr, const double& timedur) const
    {
        int hours = static_cast<int>(timedur/60.0);
        double minutes = timedur - 60.0*hours;
        double minpart, secpart;
        secpart = modf(minutes, &minpart);
        secpart = secpart*60.0;
        ostr << std::right;
        ostr << std::setw( 2) << std::setfill(' ') << std::right << hours << ":"; 
        ostr << std::setw( 2) << std::setfill('0') << static_cast<int>(minpart)      << ":"; 
        int width = 3;
        if (secpart < 9.95) { ostr << "0"; width = 2; }
        ostr << std::left << std::setw(width) << std::setprecision( 1) << std::fixed << std::setfill(' ') << secpart << std::right; 
    }
void PathFinder :: printTimeDuration ( std :: ostream & ostr , const double & timedur ) const { int hours = static_cast < int > ( timedur / 60.0 ) ; double minutes = timedur - 60.0 * hours ; double minpart , secpart ; secpart = modf ( minutes , & minpart ) ; secpart = secpart * 60.0 ; ostr << std :: right ; ostr << std :: setw ( 2 ) << std :: setfill ( ' ' ) << std :: right << hours << " " ; ostr << std :: setw ( 2 ) << std :: setfill ( ' ' ) << static_cast < int > ( minpart ) << " " ; int width = 3 ; if ( secpart < 9.95 ) { ostr << " " ; width = 2 ; } ostr << std :: left << std :: setw ( width ) << std :: setprecision ( 1 ) << std :: fixed << std :: setfill ( ' ' ) << secpart << std :: right ; }
Assuming that timedur is duration in minutes, prints a formatted version.
Assuming that timedur is duration in minutes prints a formatted version .
// double intpart, fracpart; // fracpart = modf(secpart, &intpart); // hours // minutes // seconds