{"action":"created","issue":{"url":"https://api.github.com/repos/h2database/h2database/issues/115","labels_url":"https://api.github.com/repos/h2database/h2database/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/h2database/h2database/issues/115/comments","events_url":"https://api.github.com/repos/h2database/h2database/issues/115/events","html_url":"https://github.com/h2database/h2database/issues/115","id":71491298,"number":115,"title":"to_char fails with pattern FM0D099","user":{"login":"thomasmueller","id":932377,"avatar_url":"https://avatars.githubusercontent.com/u/932377?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasmueller","html_url":"https://github.com/thomasmueller","followers_url":"https://api.github.com/users/thomasmueller/followers","following_url":"https://api.github.com/users/thomasmueller/following{/other_user}","gists_url":"https://api.github.com/users/thomasmueller/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasmueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasmueller/subscriptions","organizations_url":"https://api.github.com/users/thomasmueller/orgs","repos_url":"https://api.github.com/users/thomasmueller/repos","events_url":"https://api.github.com/users/thomasmueller/events{/privacy}","received_events_url":"https://api.github.com/users/thomasmueller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/h2database/h2database/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-28T06:08:19Z","updated_at":"2015-11-25T16:37:42Z","closed_at":null,"body":"(I transferred ownership of the thomasmueller/h2database repository, so the original issue was removed; therefore I re-create it)\r\n\r\nFunction to_char with pattern FM0D099 should format a number with the local separator and max. 3 digits after the decimal point.\r\n\r\nIt's working for \r\n    select to_char(0.111, 'FM0.099') from dual; // working (even with 0.1111)\r\nbut it fails for \r\n    select to_char(0.011, 'FM0.099') from dual; // not working\r\n\r\nError message is\r\nGeneral error: \"java.lang.StringIndexOutOfBoundsException: String index out of range: -1\" [50000-187] [SQL State=HY000, DB Errorcode=50000]\r\n\r\nFor me, the first 0 digit after the decimal point in the number seems to trigger the problem, if there are more digits to come. See this example:\r\n    select to_char(0, 'FM0D099') from dual; // working\r\n    select to_char(0.0, 'FM0D099') from dual; // working\r\n    select to_char(0.00, 'FM0D099') from dual; // not working\r\n\r\nUsing '.' instead of 'D' doesn't seem to affect the issue.\r\nRemoving 'FM' doesn't change the behaviour, either."},"comment":{"url":"https://api.github.com/repos/h2database/h2database/issues/comments/159665553","html_url":"https://github.com/h2database/h2database/issues/115#issuecomment-159665553","issue_url":"https://api.github.com/repos/h2database/h2database/issues/115","id":159665553,"user":{"login":"opticyclic","id":1222693,"avatar_url":"https://avatars.githubusercontent.com/u/1222693?v=3","gravatar_id":"","url":"https://api.github.com/users/opticyclic","html_url":"https://github.com/opticyclic","followers_url":"https://api.github.com/users/opticyclic/followers","following_url":"https://api.github.com/users/opticyclic/following{/other_user}","gists_url":"https://api.github.com/users/opticyclic/gists{/gist_id}","starred_url":"https://api.github.com/users/opticyclic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opticyclic/subscriptions","organizations_url":"https://api.github.com/users/opticyclic/orgs","repos_url":"https://api.github.com/users/opticyclic/repos","events_url":"https://api.github.com/users/opticyclic/events{/privacy}","received_events_url":"https://api.github.com/users/opticyclic/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T16:37:42Z","updated_at":"2015-11-25T16:37:42Z","body":"The pull request has been merged. Is there a plan for a release soon?"}}