c# - How to Convert to Decimal formated gridview cell with DataFormatString="{0:#,###,##0.00}" -


I try to convert to formatted decimal with DataFormatString = "{0: #, ###, #) # 0.00} " Gridview cell function Convert.ToDecimal (gridview.Rows [0] .cel [1]) some such as" Wrong string format " returns.

It seems that the format you are using for decimals is correct for culture. Not that which is used in your application.

There are two solutions:
1. For the cell use DataFormatString = "{0: D}"
2. Correctly with Decimals Try using the Trypers Number style and FormatProvider . Click for details.

In your case you should use the FR-FR culture as follows:

Decimal. Trypsers (gridview.Rows [0]. [0] Number Style Anyone, Culture InfoGetCalcherInfo ("FR-FR"), Out Wall)


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -