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

Number with formatting become a string #668

Open
konser80 opened this issue Nov 28, 2023 · 1 comment
Open

Number with formatting become a string #668

konser80 opened this issue Nov 28, 2023 · 1 comment

Comments

@konser80
Copy link

Hello!

Sometimes you have number formatting with a thousand separator like this: 2,400
And after reading it becomes a string "2,400" and not a number.
It's a pity.

Maybe... Is it possible to use like a... range.getValues() instead of range.getDisplayValues() ?
So we can keep cell type - number.

@theoephraim
Copy link
Owner

Using the cell-based methods, you can get both the raw value (the underlying number) and the "formatted value" (the string version with formatting rules applied).

The row-based API uses the much simplified spreadsheets.values api and while we could fetch the raw value vs formatted value, that api does not let you fetch both at the same time.

There is some related discussion here.

It would be a fairly large change of how the row-based methods work, and considering there is a workaround (use the cell-based methods) I don't think it will change soon.

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

2 participants