Skip to content

🐛 Bug: Decimal Auto Type Section on Excel Import #4873

@GentleGhostCoder

Description

@GentleGhostCoder

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Steps to reproduce ?

Import Excel with an example column that has Decimal and Integer Values (e.g [0.1,0.2, 1, 2]).
The detected Type for this Column is: Number

Desired Behavior

The detected Type for this Column is: Decimal

Possible fix (simple):
Change in the "ExcelTemplateAdapter.ts" file, lines 161-163:

  rows.slice(1, this.config.maxRowsToParse).every((v: any) => {
                       return v && v[col] && parseInt(v[col]) !== +v[col]
                     })

to

  rows.slice(1, this.config.maxRowsToParse).some((v: any) => {
                       return v && v[col] && parseInt(v[col]) !== +v[col]
                     })

Another possible fix (more complex):
Change "ExcelTemplateAdapter.ts" to use parserHelpers.ts -> isDecimalType(...), which already uses "some" instead "every" loop.
In addition, you could make it optional (checkbox on import) whether to use "some" or "every" when recognizing Decimal.

Project Details

Docker: false (only for MariaDB)
NC_URL (Type): mysql2
Nodejs: true (backend / frontend)

Attachements

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions