csvhelper在地图中将两倍到两个位置
对于映射类我有这个。
public sealed class MyMap : ClassMap<MyBase>
{
public MyMap()
{
Map(m => m.EventDate).Index(1);
Map(m => Math.Round(m.Price,2)).Index(2);
}
}
有没有一种方法可以在舍入时出现此错误。我知道您可以使用自定义转换器,但这似乎只是将输入截断到小数点后两位。
For mapping classes I have this.
public sealed class MyMap : ClassMap<MyBase>
{
public MyMap()
{
Map(m => m.EventDate).Index(1);
Map(m => Math.Round(m.Price,2)).Index(2);
}
}
Is there a way that will work as this errors out when rounding. I know you can use custom converters but that seems like over kill just to truncate input to two decimal places.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样的东西吗?
Something like this?