@@ -430,6 +430,8 @@ function handleFile(e) {
430
430
input_dom_element .addEventListener (' change' , handleFile, false );
431
431
```
432
432
433
+ The [ ` oldie ` demo] ( demos/oldie/ ) shows an IE-compatible fallback scenario.
434
+
433
435
</details >
434
436
435
437
More specialized cases, including mobile app file processing, are covered in the
@@ -849,11 +851,13 @@ for(var R = range.s.r; R <= range.e.r; ++R) {
849
851
850
852
### Cell Object
851
853
854
+ Cell objects are plain JS objects with keys and values following the convention:
855
+
852
856
| Key | Description |
853
857
| --- | ---------------------------------------------------------------------- |
854
858
| ` v ` | raw value (see Data Types section for more info) |
855
859
| ` w ` | formatted text (if applicable) |
856
- | ` t ` | cell type: ` b ` Boolean, ` n ` Number, ` e ` error , ` s ` String , ` d ` Date |
860
+ | ` t ` | type: ` b ` Boolean, ` e ` Error, ` n ` Number, ` d ` Date , ` s ` Text , ` z ` Stub |
857
861
| ` f ` | cell formula encoded as an A1-style string (if applicable) |
858
862
| ` F ` | range of enclosing array if formula is array formula (if applicable) |
859
863
| ` r ` | rich text encoding (if applicable) |
@@ -873,11 +877,18 @@ array range. Other cells in the range will omit the `f` field.
873
877
874
878
#### Data Types
875
879
876
- The raw value is stored in the ` v ` field, interpreted based on the ` t ` field.
880
+ The raw value is stored in the ` v ` value property, interpreted based on the ` t `
881
+ type property. This separation allows for representation of numbers as well as
882
+ numeric text. There are 6 valid cell types:
877
883
878
- Type ` b ` is the Boolean type. ` v ` is interpreted according to JS truth tables.
879
-
880
- Type ` e ` is the Error type. ` v ` holds the number and ` w ` holds the common name:
884
+ | Type | Description |
885
+ | :--: | :-------------------------------------------------------------------- |
886
+ | ` b ` | Boolean: value interpreted as JS ` boolean ` |
887
+ | ` e ` | Error: value is a numeric code and ` w ` property stores common name ** |
888
+ | ` n ` | Number: value is a JS ` number ` ** |
889
+ | ` d ` | Date: value is a JS ` Date ` object or string to be parsed as Date ** |
890
+ | ` s ` | Text: value interpreted as JS ` string ` and written as text ** |
891
+ | ` z ` | Stub: blank stub cell that is ignored by data processing utilities ** |
881
892
882
893
<details >
883
894
<summary ><b >Error values and interpretation</b > (click to show)</summary >
@@ -906,14 +917,17 @@ Since JSON does not have a natural Date type, parsers are generally expected to
906
917
store ISO 8601 Date strings like you would get from ` date.toISOString() ` . On
907
918
the other hand, writers and exporters should be able to handle date strings and
908
919
JS Date objects. Note that Excel disregards timezone modifiers and treats all
909
- dates in the local timezone. js-xlsx does not correct for this error.
920
+ dates in the local timezone. The library does not correct for this error.
921
+
922
+ Type ` s ` is the String type. Values are explicitly stored as text. Excel will
923
+ interpret these cells as "number stored as text". Generated Excel files
924
+ automatically suppress that class of error, but other formats may elicit errors.
910
925
911
- Type ` s ` is the String type. ` v ` should be explicitly stored as a string to
912
- avoid possible confusion.
926
+ Type ` z ` represents blank stub cells. They are generated in cases where cells
927
+ have no assigned value but hold comments or other metadata. They are ignored by
928
+ the core library data processing utility functions. By default these cells are
929
+ not generated; the parser ` sheetStubs ` option must be set to ` true ` .
913
930
914
- Type ` z ` represents blank stub cells. These do not have any data or type, and
915
- are not processed by any of the core library functions. By default these cells
916
- will not be generated; the parser ` sheetStubs ` option must be set to ` true ` .
917
931
918
932
#### Dates
919
933
0 commit comments