//#define XERR
#include "group.ih"

    // by probgroup/insert.cc, agegroupvsd/insert1.cc

std::ostream &operator<<(std::ostream &out, Group const &group)
{
//    out << setw(5);

    Globals::setPrecision(out, 2);

    if (group.d_series == RANGE)
    {
        out << setw(5) << group.d_begin << " - ";   //  << setw(2);

        if (
            Globals::isZero(group.d_end - END_AGE)
            or 
            Globals::isZero(group.d_end - Globals::uint16_max)
        )
            out << " *   ";
        else
            out << group.d_end;
    }
    else if (Globals::isZero(group.d_end - Globals::uint16_max))    // SINGLE
        out << " *   ";
    else
        out << setw(5) << group.d_end;

    return out;
}


