MiniExcel icon indicating copy to clipboard operation
MiniExcel copied to clipboard

Working with Columns with Currency type

Open GilEducbank opened this issue 2 years ago • 0 comments

Excel Type

  • [x] XLSX

Upload Excel File

Please attach your issue file by dragging or droppng, selecting or pasting them.

cc07-08-2023T15_55_13.xlsx

MiniExcel Version

1.31

Description

When using the Miniexcel library to generate columns with numeric currency (R$) formats, the numbers are being displayed as strings in the format "R$ 500.00" instead of being displayed as numeric values like "500.00".

Steps to Reproduce

  1. Import the Miniexcel library into a project.

  2. Use the provided class as an example and define properties with the ExcelColumn attribute, applying currency formats to numeric values.

  3. Generate an Excel file using the Miniexcel library and populate values in the defined columns.

Expected Behavior

Values in columns formatted with the ExcelColumn attribute and the currency format (R$) should be displayed as numeric values, e.g., "500.00".

Current Behavior

Values in formatted columns are being displayed as strings in the "R$ 500.00" format.

Example Class Snippet

[ExcelColumn(Name = CessionConsts.Columns.PaymentValueName, Index = 19, Format = "R$ #,##0.00", Width = 15)]
public long PaymentValue { get; set; }

[ExcelColumn(Name = CessionConsts.Columns.PaymentDateName, Index = 20, Format = "dd/MM/yyyy", Width = 15)]
public DateTime PaymentDate { get; set; }

[ExcelColumn(Name = CessionConsts.Columns.ValueToSettleName, Index = 21, Format = "R$ #,##0.00", Width = 15)]
public long ValueToSettle { get; set; }

Those are the 3 last properties as example.
Thanks

GilEducbank avatar Aug 07 '23 19:08 GilEducbank