numeric_to_number() function skipping some digits - Mailing list pgsql-hackers

From Jeevan Chalke
Subject numeric_to_number() function skipping some digits
Date
Msg-id be46a4f30909180247p542b2b46ya260d51e84df51a0@mail.gmail.com
Whole thread Raw
Responses Re: numeric_to_number() function skipping some digits
List pgsql-hackers
Hi,<br /><br />With PG84, I have tried something like this which seem incorrect to me.<br /><br /># SELECT '' AS
to_number_2, to_number('-347,58', '99G999');<br /> to_number_2 | to_number <br />-------------+-----------<br />
            |     -3458<br />(1 row)<br /><br />After browsing the code (numeric_to_number), I have found that number
stringis processed according to the number format. Which means, when 'G' is found in the format we have moved the
numberpointer to next character. This is why the digit '7' is skipped. And while processing ',', as it is not a digit
itis ignored.<br /><br />Is this expected behaviour? or a bug?<br /><br />Thanks<br /><br />-- <br />Jeevan B Chalke<br
/>EnterpriseDBSoftware India Private Limited, Pune<br />Visit us at: <a
href="http://www.enterprisedb.com">www.enterprisedb.com</a><br/> --- <br />If better is possible, then good is not
enough<br/><br /> 

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Feedback on getting rid of VACUUM FULL
Next
From: Fujii Masao
Date:
Subject: Re: Streaming Replication patch for CommitFest 2009-09