Coder Social home page Coder Social logo

Comments (7)

mjul avatar mjul commented on August 17, 2024 1

Please submit a PR if it would be useful to provide a helper function in the Clojure library that wraps a call to this formatter.

from docjure.

mjul avatar mjul commented on August 17, 2024

In general, Excel prefers numbers.
If you are up to it, you can have a look at the Docjure code to see how it reads the cell value. Maybe there is a clue there.
You can also try applying the clojure str function to turn the data into strings.

from docjure.

keithmantell avatar keithmantell commented on August 17, 2024

Hi, tried the str function bit that just gives the floating point version in quotes!
I did look at the code. I'm not an expert but will think about submitting a change. My work around is to save the spreadsheet as a CSV and read that!
Thanks

from docjure.

kimim avatar kimim commented on August 17, 2024

I've tested in Excel. By default, number string is stored as number.
When the field with small green triangle, indicates it is a number stored as string:

https://support.microsoft.com/en-us/office/fix-text-formatted-numbers-by-applying-a-number-format-6599c03a-954d-4d83-b78a-23af2c8845d0#__toc260840018

from docjure.

kimim avatar kimim commented on August 17, 2024

"2014" in this file is treated as string.
1900-based-dates.xlsx
number-stored-as-string

from docjure.

andres-moreno avatar andres-moreno commented on August 17, 2024

I noticed that when reading a 10-digit integer I would also get a floating-point number. I decided on a lark to format it using cl-format (the formatting string used was "~14,'0d". It turns out that this will give me a 14-digit, zero left-padded string!

from docjure.

viesti avatar viesti commented on August 17, 2024

I ran into this also, and found an SO post, which points to org.apache.poi.ss.usermodel.DataFormatter.formatCellValue, which seems useful, based on the javadoc, if you want a string that looks the same as in Excel:

DataFormatter contains methods for formatting the value stored in a Cell. This can be useful for reports and GUI presentations when you need to display data exactly as it appears in Excel.

from docjure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.