简体   繁体   中英

How to get the cell value as a currency of excel sheet

I set excel sheet one of the the column as a currency format $ and decimal places 2. Like $0.00.

But while displaying in datagridview in it showing like :0.0000. If set currency as none.Then it is showing 0.00. If i add $ symbol. it is showing extra digits values.

Can you please help how can i show as it is (mean like:$0.00) only In windows application.

you have to give a format to your currency datagrid field. that is, assign to that column a property called DataFormatString and value of {0:c}

for additional info: check that link http://msdn.microsoft.com/en-us/library/aa479342.aspx

Try that

<asp:BoundField DataField="Money" DataFormatString="{0:c2}" HeaderText="Money"
                    SortExpression="Money" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM