Convert currency string to decimal?

后端 未结 6 933
北恋
北恋 2020-12-05 13:00

Objective

Sort a string that is displaying currency data like this $1,995.94 numerically in a set of data.

Code

I\'m cu

6条回答
  •  感情败类
    2020-12-05 13:09

    decimal amount = decimal.Parse("$123,456.78",
    NumberStyles.AllowCurrencySymbol |
    NumberStyles.AllowThousands |
    NumberStyles.AllowDecimalPoint);
    

提交回复
热议问题