PostgreSQL Source Code  git master
printf_hack.h File Reference

Go to the source code of this file.

Functions

static void print_double (double x)
 

Function Documentation

◆ print_double()

static void print_double ( double  x)
static

Definition at line 6 of file printf_hack.h.

7 {
8 #ifdef WIN32
9  /* Change Windows' 3-digit exponents to look like everyone else's */
10  char convert[128];
11  int vallen;
12 
13  sprintf(convert, "%g", x);
14  vallen = strlen(convert);
15 
16  if (vallen >= 6 &&
17  convert[vallen - 5] == 'e' &&
18  convert[vallen - 3] == '0')
19  {
20  convert[vallen - 3] = convert[vallen - 2];
21  convert[vallen - 2] = convert[vallen - 1];
22  convert[vallen - 1] = '\0';
23  }
24 
25  printf("%s", convert);
26 #else
27  printf("%g", x);
28 #endif
29 }
int x
Definition: isn.c:71
#define sprintf
Definition: port.h:240
#define printf(...)
Definition: port.h:244
static void convert(const int32 val, char *const buf)
Definition: zic.c:1992

References convert(), printf, sprintf, and x.