Fix implementation of "e" and "g" formats for printing floating points