Jake Pangan
Jake Pangan

Reputation: 33

Importing Excel Data to datatable with format currency

I am importing data from an excel file to a vb datatable with one column having a 'currency' format. However, upon retrieval, I noticed that the currency sign is no longer included in the datatable. How to include the currency sign? Thank you.

Upvotes: 1

Views: 304

Answers (1)

AustinS90
AustinS90

Reputation: 153

You can try setting the format of the data grids cell.

Something such as this might work:

DataGridView.Columns("CurrencyColumn").DefaultCellStyle.Format = "C"

And I believe if you want to set it to a desired amount as decimal places, you can do as such

DataGridView.Columns("CurrencyColumn").DefaultCellStyle.Format = "C2"

The above should set it to 2 decimal places, which I believe can be switched with other numbers as well

Upvotes: 1

Related Questions