开发者

DataGridView TextBox value conversion to decimal (with fixed point)

In a TextBox in DataGridView when I type in example 50.30 and then I convert it to decimal using:

decimal money = Convert.ToDecimal(dgv.Rows[0].Cells[2].Value);

it conver开发者_JAVA百科ts to 5030, not to 50.30... :(

or if it's 50 I need it to be converted to 50,0000 like the money type in sql server.

Any help?

thank you


You should use

Convert.ToDecimal(Object value, IFormatProvider provider)

Where provider is instace of your class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜