Title: All numbers are read as Float · Issue #100 · pythonicrubyist/creek · GitHub
Open Graph Title: All numbers are read as Float · Issue #100 · pythonicrubyist/creek
X Title: All numbers are read as Float · Issue #100 · pythonicrubyist/creek
Description: When reading an excel file that is exported from other libraries, for example caxlsx https://github.com/caxlsx/caxlsx The library generates Excel with floats and integers represented with t="n", for example from the "sheet1.xml" X Description: When reading an excel file that is exported from other libraries, for example caxlsx https://github.com/caxlsx/caxlsx The library generates Excel with floats and integers represented with t="n...
Opengraph URL: https://github.com/pythonicrubyist/creek/issues/100
X: @github
Domain: patch-diff.githubusercontent.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"All numbers are read as Float","articleBody":"When reading an excel file that is exported from other libraries, for example caxlsx https://github.com/caxlsx/caxlsx\r\nThe library generates Excel with floats and integers represented with t=\"n\", for example from the \"sheet1.xml\"\r\n\r\n```\r\n\u003cc r=\"Z2\" s=\"0\" t=\"n\"\u003e\u003cv\u003e1.0\u003c/v\u003e\u003c/c\u003e\r\n\u003cc r=\"G2\" s=\"0\" t=\"n\"\u003e\u003cv\u003e114\u003c/v\u003e\u003c/c\u003e\r\n```\r\n\r\nBoth of these numbers are read by Creek as: 1.0 , 114.0, which is causing problems when the system expects to see an integer value instead of float, for example when using that number to load Models from the Database\r\n\r\nI have found in this line https://github.com/pythonicrubyist/creek/blob/master/lib/creek/styles/converter.rb#L47\r\nThat Creek always read the value as float.\r\n\r\nMy suggestion is to replace\r\n```\r\nvalue.to_f\r\n```\r\nwith\r\n```\r\nif value.to_i.to_s == value.to_s\r\n value.to_i\r\n else\r\n value.to_f\r\n end\r\n```\r\n\r\nI don't know if this is the right solution or not, but by applying this as a patch in the system solved our problem.","author":{"url":"https://github.com/amhofny","@type":"Person","name":"amhofny"},"datePublished":"2021-08-25T06:29:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/100/creek/issues/100"}
route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:58420a7b-0d1e-5160-1526-6de51812e304 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id A528:26B0AA:4CD8E13:6776F07:696E11E5 html-safe-nonce 8fcd7af0b8b2bd5a1d96ccae5060f2c9d18d565cbe2cf43f566c4bbcc5978b33 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTI4OjI2QjBBQTo0Q0Q4RTEzOjY3NzZGMDc6Njk2RTExRTUiLCJ2aXNpdG9yX2lkIjoiNDcwOTg3MzU2NjkzNzI5NzY1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac 66ee36e3aefa31ff74ad6bff6e0fa1d9c690d17188c2d25653cb4773a958912c hovercard-subject-tag issue:978769134 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonicrubyist/creek/100/issue_layout twitter:image https://opengraph.githubassets.com/c1bb51bdfd2a9dc831fbc430fd81cbbd855a2107231c47ea05087d7e808d7f7f/pythonicrubyist/creek/issues/100 twitter:card summary_large_image og:image https://opengraph.githubassets.com/c1bb51bdfd2a9dc831fbc430fd81cbbd855a2107231c47ea05087d7e808d7f7f/pythonicrubyist/creek/issues/100 og:image:alt When reading an excel file that is exported from other libraries, for example caxlsx https://github.com/caxlsx/caxlsx The library generates Excel with floats and integers represented with t="n", fo... og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username amhofny hostname github.com expected-hostname github.com None 1a7d6d739bf034e67486b9f97a31887ca30302b72a0acac49b6bcddff34356d7 turbo-cache-control no-preview go-import github.com/pythonicrubyist/creek git https://github.com/pythonicrubyist/creek.git octolytics-dimension-user_id 1863594 octolytics-dimension-user_login pythonicrubyist octolytics-dimension-repository_id 10825818 octolytics-dimension-repository_nwo pythonicrubyist/creek octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 10825818 octolytics-dimension-repository_network_root_nwo pythonicrubyist/creek turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 87d7872ec7094ed247923539669aabda9230966f ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.