Skip to content

Commit

Permalink
Merge pull request #15 from gkostov/master
Browse files Browse the repository at this point in the history
Handle the "inlineStr" cell type when reading cell values.
  • Loading branch information
jansivans authored Apr 10, 2020
2 parents 9409de7 + 512f00d commit b13caa5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ function getTransform(formats: (string | number)[], strings: string[], dict?: IM
for (let i = 0; i < children.length; i++) {
const ch = children[i];
if (ch.children) {
let value = ch.children.v.value;
if (ch.attribs.t === 's') {
value = strings[value];
let value: any;
if (ch.attribs.t === 'inlineStr') {
value = ch.children.is.children.t.value;
} else {
value = ch.children.v.value;
if (ch.attribs.t === 's') {
value = strings[value];
}
}
value = isNaN(value) ? value : Number(value);
let column = ch.attribs.r.replace(/[0-9]/g, '');
Expand Down Expand Up @@ -347,4 +352,4 @@ export function getWorksheets(options: IWorksheetOptions) {
processWorkbook();
});
});
}
}

0 comments on commit b13caa5

Please sign in to comment.