-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Auto converting string data with all integer to exponential. #2609
Comments
To force the string 121212121212121, Excel needs to see Currently, this can be generated by setting the formula of a cell. A sample: https://jsfiddle.net/sheetjs/no2gx45e/ var num = 121212121212121, str = "121212121212121";
var ws = XLSX.utils.aoa_to_sheet([
["num", num ], // { t: "n", n: num }. -> 1.21212E+14 -> number
["str", str ], // { t: "s", v: str } -> 121212121212121 -> number
["numfmla", { f: str } ], // { f: str } -> =121212121212121 -> number
["strfmla", { f: `"${str}"` } ] // { f: '"' + str + '"' } -> ="121212121212121" -> string
]); We'd accept a PR that looks for strings that may be interpreted as numbers. https://github.com/SheetJS/sheetjs/blob/master/bits/90_utils.js#L111-L112 is where the actual string values are generated, and a simple check using parseInt would address the problem. |
|
Give 2 and 11 value |
Hi, should it do something like this ?
|
Is the issue still open? I would like to take it up if that is the case. |
Check for strings that may be interpreted as numbers (fixes SheetJS#2609)
@SheetJSDev Can you please assign this issue to me? |
Hi @SheetJSDev , is this issue still unsolved? I would like to take it up |
While writing string data (example = "121212121212121" -> string of all integer characters) into excel.
while user download and see, the downloaded xl/CSV, the data is shown in exponential format. Is there a way to show the same data. without converting into exponential in this case.
The text was updated successfully, but these errors were encountered: