Skip to content

Commit c27d95e

Browse files
committed
The patch fix bug described in TODO:
* to_char(0,'FM999.99') returns a period, to_char(1,'FM999.99') does not Karel Zak
1 parent c51a049 commit c27d95e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/backend/utils/adt/formatting.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.55 2002/09/20 03:54:57 momjian Exp $
4+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.56 2002/09/20 03:57:09 momjian Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2002, PostgreSQL Global Development Group
@@ -3767,11 +3767,11 @@ NUM_numpart_to_char(NUMProc *Np, int id)
37673767
strcpy(Np->inout_p, Np->decimal); /* Write DEC/D */
37683768
Np->inout_p += strlen(Np->inout_p);
37693769

3770-
/*
3771-
* terrible Ora '0' -- 9.9 --> '0.'
3772-
*/
37733770
}
3774-
else if (IS_FILLMODE(Np->Num) && *Np->number == '0' &&
3771+
/*
3772+
* Ora 'n' -- FM9.9 --> 'n.'
3773+
*/
3774+
else if (IS_FILLMODE(Np->Num) &&
37753775
Np->last_relevant && *Np->last_relevant == '.')
37763776
{
37773777

@@ -3798,11 +3798,10 @@ NUM_numpart_to_char(NUMProc *Np, int id)
37983798
{
37993799
*Np->inout_p = ' ';
38003800
++Np->inout_p;
3801-
3802-
/*
3803-
* total terrible Ora: '0' -- FM9.9 --> '0.'
3804-
*/
38053801
}
3802+
/*
3803+
* total terrible Ora: '0' -- FM9.9 --> '0.'
3804+
*/
38063805
else if (Np->last_relevant && *Np->last_relevant == '.')
38073806
{
38083807
*Np->inout_p = '0';

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy