Skip to content

Conversation

@davidaso28
Copy link

Hello,
First of all, I would like to say congratulations on your fantastic job with this library; it is handy and easy to understand.

I have made just a small change creating a property to determine if the library has to map the value ignoring the cell type or format established and just return plain text.

@codecov
Copy link

codecov bot commented Aug 20, 2020

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.77%. Comparing base (5253506) to head (d6610d8).
⚠️ Report is 366 commits behind head on master.

Files with missing lines Patch % Lines
ExcelMapper/ExcelMapper.cs 0.00% 2 Missing and 1 partial ⚠️
ExcelMapper/TypeMapper.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
- Coverage   90.34%   89.77%   -0.57%     
==========================================
  Files           6        6              
  Lines         632      636       +4     
  Branches       77       78       +1     
==========================================
  Hits          571      571              
- Misses         50       53       +3     
- Partials       11       12       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mganss
Copy link
Owner

mganss commented Aug 20, 2020

What's the use case for this? Numeric cells that are mapped to string properties should automatically get the formatted value now.

@davidaso28
Copy link
Author

I have some cells that are formatted as date with content 10-11 when I call the fetch method I receive 10/11/2020 if I change the Data Formatter for a custom DataFormatter I would affect whole the date's interpretation. I want to determine with this flag when I want to get the text value and when I want to apply the data format.

Also, when you have a custom format in excel sheet you can avoid any data transformation by demand.

Please let me know if there is another way to achieve this.

Thanks for your quick reply.

@mganss
Copy link
Owner

mganss commented Aug 20, 2020

Sorry, I don't get it. The cells that are date formatted as "10-11" should be mapped to a string property using the format specified in the Excel sheet so you'll get the string "10-11" in your string property. What exactly do you mean with the text value? Date cells are numeric cells and as such are stored as numbers in the Excel sheet. If you don't want/need the formatted string you can always map to a DateTime.

Can you post an example Excel sheet along with the class you're mapping to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants