{"action":"closed","issue":{"url":"https://api.github.com/repos/josdejong/mathjs/issues/901","repository_url":"https://api.github.com/repos/josdejong/mathjs","labels_url":"https://api.github.com/repos/josdejong/mathjs/issues/901/labels{/name}","comments_url":"https://api.github.com/repos/josdejong/mathjs/issues/901/comments","events_url":"https://api.github.com/repos/josdejong/mathjs/issues/901/events","html_url":"https://github.com/josdejong/mathjs/issues/901","id":244865715,"number":901,"title":"Unit's .toNumeric() incorrect immediately after calculation with mixed units","user":{"login":"AlexanderBeyn","id":706510,"avatar_url":"https://avatars3.githubusercontent.com/u/706510?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderBeyn","html_url":"https://github.com/AlexanderBeyn","followers_url":"https://api.github.com/users/AlexanderBeyn/followers","following_url":"https://api.github.com/users/AlexanderBeyn/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderBeyn/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderBeyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderBeyn/subscriptions","organizations_url":"https://api.github.com/users/AlexanderBeyn/orgs","repos_url":"https://api.github.com/users/AlexanderBeyn/repos","events_url":"https://api.github.com/users/AlexanderBeyn/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderBeyn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-07-22T19:14:06Z","updated_at":"2017-08-12T18:11:19Z","closed_at":"2017-08-12T18:11:19Z","body":"When doing calculations with mixed units, such as multiplying feet and meters, .toNumeric() returns an incorrect value immediately after the calculation. Once .formatUnits() has been called on the result, .toNumeric() returns the correct value.  \r\n\r\nAn example at http://jsbin.com/wusavigugi/edit?html,js,output shows that \r\n```\r\n    const a = math.unit(1, 'ft').multiply(math.unit(1, 'meter'))\r\n    document.write(a.toNumeric() + '<br>');\r\n    document.write(a.formatUnits() + '<br>');\r\n    document.write(a.toNumeric() + '<br>');\r\n```\r\n\r\noutputs\r\n```\r\n1\r\nmeter^2\r\n0.3048\r\n```"}}
{"actor":{"display_login":"josdejong"}}