diff --git a/docs/define-column-types.md b/docs/define-column-types.md index 39e5eba..beb3cfc 100644 --- a/docs/define-column-types.md +++ b/docs/define-column-types.md @@ -1,5 +1,7 @@ -# Define Column Types +# Define Column Types (CSV files) -SQLSeal sets types of your data automatically. This is the mechanism which for most of the cases works perfectly, but for more advanced use-cases, you might want to force specific type of the column (for example you might have ids which you want to treat like text, even if they consist of just the numbers). To enforce the specific type, you can set individual types inside the CSV Viewer: +SQLSeal sets types of your data automatically. This is the mechanism which for most of the cases works perfectly, but for more advanced use-cases, you might want to force specific type of the column (for example you might have ids which you want to treat like text, even if they consist of just the numbers). To enforce a specific type, you can set individual types inside the CSV Viewer: ![Setting Column Type](./setting-column-type.png) + +Changing data type enables corresponding controls. \ No newline at end of file diff --git a/docs/setting-column-type.png b/docs/setting-column-type.png index 5d67870..1b632a3 100644 Binary files a/docs/setting-column-type.png and b/docs/setting-column-type.png differ diff --git a/src/view/CSVView.ts b/src/view/CSVView.ts index 605df6c..e1576b3 100644 --- a/src/view/CSVView.ts +++ b/src/view/CSVView.ts @@ -233,7 +233,7 @@ export class CSVView extends TextFileView { if (d[key] === null || d[key] === '') { d[key] = '' } else { - d[key] = parseInt(d[key] as string, 10) + d[key] = parseFloat(d[key] as string) } } if (value.type === 'date') {