- draw_tick (cr, geom, SCALE_ABSCISSA, bins > 10,
- x_pos + width / 2.0, "%.*g",
- DBL_DIG + 1, (upper + lower) / 2.0);
+ {
+ struct decimal decupper;
+ struct decimal declower;
+ struct decimal middle;
+ decimal_from_double (&declower, lower);
+ decimal_from_double (&decupper, upper);
+ middle = declower;
+ decimal_add (&middle, &decupper);
+ decimal_int_divide (&middle, 2);
+ char *str = decimal_to_string (&middle);
+ draw_tick (cr, geom, SCALE_ABSCISSA, bins > 10,
+ x_pos + width / 2.0, "%s", str);
+ free (str);
+ }