Solved

exporting a money field to excel

Posted on 2016-09-15
3
42 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
ElrondCT earned 500 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

726 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