更新时间:2023-11-05 09:28:10
只需调用ToString
即可获取十进制值的字符串表示形式:
Just call ToString
to get a string representation of the decimal value:
order.Total = orderTotal.ToString("G");
尽管我不明白为什么将成员Total
存储为string
而不存储为decimal
.
Although I don't see why you would store the member Total
as a string
and not as a decimal
too.