{"action":"created","issue":{"url":"https://api.github.com/repos/cogneco/ooc-kean/issues/643","labels_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/643/labels{/name}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/643/comments","events_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/643/events","html_url":"https://github.com/cogneco/ooc-kean/issues/643","id":114212740,"number":643,"title":"Text toNumeric needs to handle leading whitespace","user":{"login":"davidhesselbom","id":4319680,"avatar_url":"https://avatars.githubusercontent.com/u/4319680?v=3","gravatar_id":"","url":"https://api.github.com/users/davidhesselbom","html_url":"https://github.com/davidhesselbom","followers_url":"https://api.github.com/users/davidhesselbom/followers","following_url":"https://api.github.com/users/davidhesselbom/following{/other_user}","gists_url":"https://api.github.com/users/davidhesselbom/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhesselbom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhesselbom/subscriptions","organizations_url":"https://api.github.com/users/davidhesselbom/orgs","repos_url":"https://api.github.com/users/davidhesselbom/repos","events_url":"https://api.github.com/users/davidhesselbom/events{/privacy}","received_events_url":"https://api.github.com/users/davidhesselbom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cogneco/ooc-kean/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/cogneco/ooc-kean/labels/high","name":"high","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-30T06:41:54Z","updated_at":"2015-10-30T06:52:40Z","closed_at":null,"body":"This \r\n```ooc\r\ntext := t\" 1.0\"\r\nprintln(text toFloat() toString())\r\nstring := text toString()\r\nprintln(string toFloat() toString())\r\n```\r\nprints\r\n```\r\n0.00\r\n1.00\r\n```\r\nbecause `String` uses the standard library function `strtof` under the hood, and it can handle leading whitespace, while the conversion functions in `Text` cannot. This has lead to #575 limiting parse functions to work only when the input has no whitespace separating the components of e.g. a `FloatPoint2D`.\r\n\r\nThe fix is simple: implement a `trim` function in `Text` (could be useful for other reasons, too) and use it on `Text` instances before trying to convert it to a numeric type, or, better yet, let the conversion functions call `trim` before they do anything else."},"comment":{"url":"https://api.github.com/repos/cogneco/ooc-kean/issues/comments/152444297","html_url":"https://github.com/cogneco/ooc-kean/issues/643#issuecomment-152444297","issue_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/643","id":152444297,"user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T06:52:40Z","updated_at":"2015-10-30T06:52:40Z","body":"Sorry, not at the moment, I still have some PR debts to pay here and in the other project:)"}}