Fix corner case bug in numeric to_char().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Sep 2011 21:06:10 +0000 (17:06 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Sep 2011 21:07:20 +0000 (17:07 -0400)
commitf0bedf3e456c52274995d32d4c0c8a250de5c1ca
treebe62ba517d9878f9510eeaabc30434419388a105
parent7b8e10f2bed1d450a9f9b211ae1b883227443912
Fix corner case bug in numeric to_char().

Trailing-zero stripping applied by the FM specifier could strip zeroes
to the left of the decimal point, for a format with no digit positions
after the decimal point (such as "FM999.").

Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.
src/backend/utils/adt/formatting.c
src/test/regress/expected/numeric.out
src/test/regress/sql/numeric.sql