replace gcvt by sprintf for better portability