numeric_to_number() function skipping some digits
От | Jeevan Chalke |
---|---|
Тема | numeric_to_number() function skipping some digits |
Дата | |
Msg-id | be46a4f30909180247p542b2b46ya260d51e84df51a0@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: numeric_to_number() function skipping some digits
|
Список | 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 по дате отправления: