Skip to content

Commit daa37f5

Browse files
authoredJan 16, 2019
Merge pull request alexcaza#7 from devlavshah/variable_fix
Replaced variable to be camel case
2 parents cfb35fb + f54499b commit daa37f5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var data = [
4343
const options = {
4444
fieldSeparator: ',',
4545
quoteStrings: '"',
46-
decimalseparator: '.',
46+
decimalSeparator: '.',
4747
showLabels: true,
4848
showTitle: true,
4949
title: 'My Awesome CSV',
@@ -67,7 +67,7 @@ csvExporter.generateCsv(data);
6767
| **fieldSeparator** | , | Defines the field separator character |
6868
| **filename** | 'generated' | Sets the name of the downloaded file. ".csv" will be appended to the value provided. |
6969
| **quoteStrings** | " | If provided, will use this characters to "escape" fields, otherwise will use double quotes as deafult |
70-
| **decimalseparator** | . | Defines the decimal separator character (default is .). If set to "locale", it uses the [language sensitive representation of the number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString).|
70+
| **decimalSeparator** | . | Defines the decimal separator character (default is .). If set to "locale", it uses the [language sensitive representation of the number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString).|
7171
| **showLabels** | false | If true, the first row will be the `headers` option or object keys if `useKeysAsHeaders` is present|
7272
| **showTitle** | false | Includes the title as the first line in the generated file |
7373
| **title** | 'My Generated Report' | This string will be used as the report title |

‎export-to-csv.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export interface Options {
22
filename?: string;
33
fieldSeparator?: string;
44
quoteStrings?: string;
5-
decimalseparator?: string;
5+
decimalSeparator?: string;
66
showLabels?: boolean;
77
showTitle?: boolean;
88
title?: string;
@@ -35,7 +35,7 @@ export const ConfigDefaults: Options = {
3535
filename: CsvConfigConsts.DEFAULT_FILENAME,
3636
fieldSeparator: CsvConfigConsts.DEFAULT_FIELD_SEPARATOR,
3737
quoteStrings: CsvConfigConsts.DEFAULT_QUOTE,
38-
decimalseparator: CsvConfigConsts.DEFAULT_DECIMAL_SEPARATOR,
38+
decimalSeparator: CsvConfigConsts.DEFAULT_DECIMAL_SEPARATOR,
3939
showLabels: CsvConfigConsts.DEFAULT_SHOW_LABELS,
4040
showTitle: CsvConfigConsts.DEFAULT_SHOW_TITLE,
4141
title: CsvConfigConsts.DEFAULT_TITLE,
@@ -171,12 +171,12 @@ export class ExportToCsv {
171171
*/
172172
private _formatData(data: any) {
173173

174-
if (this._options.decimalseparator === 'locale' && this._isFloat(data)) {
174+
if (this._options.decimalSeparator === 'locale' && this._isFloat(data)) {
175175
return data.toLocaleString();
176176
}
177177

178-
if (this._options.decimalseparator !== '.' && this._isFloat(data)) {
179-
return data.toString().replace('.', this._options.decimalseparator);
178+
if (this._options.decimalSeparator !== '.' && this._isFloat(data)) {
179+
return data.toString().replace('.', this._options.decimalSeparator);
180180
}
181181

182182
if (typeof data === 'string') {

0 commit comments

Comments
 (0)
Please sign in to comment.