Logo Search packages:      
Sourcecode: s390-tools version File versions  Download package

void Printer::print_abbrev_num ( FILE *  fp,
double  num 
) const [protected, inherited]

Print floats always using 6 characters

Always print doubles using 6 characters: 5 for a 3.1 format and 1 for an optional character giving the magintude.

Definition at line 217 of file ziorep_printers.cpp.

References Printer::m_csv.

{
      int  rc = 0;
      char tmp[128];

      if (m_csv) {
            fprintf(fp, "%.1lf", num);
            return;
      }

      if (num == 0) {
            fprintf(fp, "  0.0 ");
            return;
      }

      /* print into a tmp buffer first - if buf is too small we might
         write out of bounds otherwise! */
      rc = sprintf(tmp, "%lld", (long long int)num);
      if (rc < 4)
            fprintf(fp, "%5.1lf ", num);
      else
            print_abbreviated(fp, num, rc, 6);
}

Generated by  Doxygen 1.6.0   Back to index