Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(DynamicExcelColumn): make the CustomFormatter property more powerful #715

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

izanhzh
Copy link
Member

@izanhzh izanhzh commented Jan 23, 2025

fix: #708

我注意到,在此前的PR #700 中,DynamicExcelColumn增加了一个属性:

public Func<object, string> CustomFormatter { get; set; }

这个PR存在一些问题,假设我原来的值是数字类型,因为这里返回的值是string类型,并且因为调用CustomFormatter委托时机问题,导致最终生成的Excel单元个设置是数字但实际值非数字,Excel打开报错,例如,我想对金额加一个币别符号1 -> $1

我进行了一些优化,调整为 Func<object, object>,可以避免此问题

@izanhzh izanhzh requested a review from shps951023 January 23, 2025 03:39
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.

写文件时,对格式化数据的支持
1 participant