0

我需要在我用这种格式的 LINQtoCSV 库编写的 .csv 文件中格式化十进制字段:95.43000000for that format 95.43。我像这样映射这个字段:

[CsvColumn(Name = "Price", OutputFormat = "C")]
public decimal? Price { get; set; }

这给了我一个货币价值$95.43。我加载数据,使其精确到小数点后 6 位,但我需要在末尾消除零字符串:

Price = Math.Round(AdjustPrice(x.Price, x.Ticker), 6)

任何人都可以帮忙吗?

4

0 回答 0