Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

exporting a money field to excel

Posted on 2016-09-15
3
Medium Priority
?
48 Views
Last Modified: 2016-09-20
Hello,
I am exporting datagridview to excel .
The money field which has values like :
61,999.65  from datagridview gets exported as 61999.65
how to get comma , exported?


 xlRange = xlWorkSheet.Range("H1")
                    xlRange.EntireColumn.NumberFormat = "#,##0.00"
0
Comment
Question by:RIAS
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
ElrondCT earned 2000 total points
ID: 41802161
The NumberFormat you show should give the correct display (commas for thousands, two digits after the decimal) in Excel. I'd do it as

 xlWorkSheet.Range("H:H").NumberFormat = "#,##0.00"
0
 

Author Comment

by:RIAS
ID: 41802194
Thanks will try and get back
0
 

Author Closing Comment

by:RIAS
ID: 41806042
Thanks mate!
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question