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
Post a Comment