Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbers as text #652

Open
myfitment opened this issue May 27, 2020 · 1 comment
Open

Numbers as text #652

myfitment opened this issue May 27, 2020 · 1 comment

Comments

@myfitment
Copy link

Hey, just trying to do a really simple thing and write a 13 digit numeric string and store it as text. Don't want scientific notation. This gem doesn't accept the standard Excel behavior for this. If I type a single quote, and then a 13 digit number into an Excel cell, that signals to Excel to store the number as text. This gem stores the number as text, but it keeps the single quote. That's not correct, and it's counterintuitive behavior.

If I type an equals sign into Excel, then a double quote, then a 13 digit number, then another double quote, that signals to Excel to store the number as text. This gem stores it as scientific notation. That's not correct behavior.

What exactly is it I need to do to store a number so that it's not converted to a float with .0 on the end when I read it?

@nukturnal
Copy link

I think you can enforce this by specifying the datatype for the exact cell you want with the types params which expects an array of various types float, string, boolean, nil should auto format it.

sheet.add_row [1, "Some Text", 20023839932], types: [nil, nil, :string]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant