String to decimal parsing C#

前端 未结 3 644
盖世英雄少女心
盖世英雄少女心 2021-01-21 13:44

I am trying to parse or convert a string to decimal in C#.

I need to be able to parse strings like,

$123,345,676.8999 to its equivalent 123345676.90.

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-21 13:47

    You can use decimal.TryParse to perform the parsing -- the link has some samples on how the parsing works.

提交回复
热议问题