File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
5
5
*
6
- * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.70 2005/07/18 18:58:45 momjian Exp $
6
+ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.71 2005/07/18 19:27:37 momjian Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "common.h"
@@ -65,17 +65,18 @@ integer_digits(const char *my_str)
65
65
static int
66
66
len_numericseps (const char * my_str )
67
67
{
68
- int int_len = integer_digits (my_str ), sep_len ;
68
+ int int_len = integer_digits (my_str ), len = 0 ;
69
69
int groupdigits = atoi (grouping );
70
70
71
- if (int_len == 0 )
72
- sep_len = 0 ;
73
- else
71
+ if (int_len > 0 )
74
72
/* Don't count a leading separator */
75
- sep_len = int_len / groupdigits - (int_len % groupdigits == 0 );
73
+ len = (int_len / groupdigits - (int_len % groupdigits == 0 )) *
74
+ strlen (thousands_sep );
76
75
77
- return sep_len * strlen (thousands_sep ) -
78
- strlen ("." ) + strlen (decimal_point );
76
+ if (strchr (my_str , '.' ) != NULL )
77
+ len += strlen (decimal_point ) - strlen ("." );
78
+
79
+ return len ;
79
80
}
80
81
81
82
static int
You can’t perform that action at this time.
0 commit comments