Fix corner case bug in numeric to_char().
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/formatting.c | modified | +20 −7 |
| src/test/regress/expected/numeric.out | modified | +18 −0 |
| src/test/regress/sql/numeric.sql | modified | +4 −0 |