Solved

Format Currency with no decimal places eg $1000

Posted on 2003-11-17
6
2,340 Views
Last Modified: 2009-08-26
VB6:

I've got a program that deals with BIG (multi-million) dollar values.  The user isn't interested in seeing the cents, but they DO want to see the currency symbol.  Fair enough.

If I use the VB Format(MyNumber,"Currency") syntax, VB always displays two decimal places (even if the number has been rounded first, i .e. Format(Round(MyNumber,0),"Currency") will give $100,00.00.  

How can I display these numbers with the appropriate currency formating for the users machine (it's used worldwide) and hide the last two decimal places?

Will raise the amount of points if it turns out to be a WinAPI type solution.

It seems so easy.....
0
Comment
Question by:MushyPeas
[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
  • 3
  • 2
6 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 50 total points
ID: 9768216
Fairly easy:

FormatCurrency(MyNumber,0)
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9768373
Also, please maintain your old open questions:

1 06/24/2003 100 VB.Net generated control in VB6.0 projec...  Open VB Controls
2 08/13/2003 200 MDAC_TYP Versions - OK to use 2.7?  Open VB Databases
3 09/18/2003 50 .oca,.lib,.exp files... do I need to dis...  Open VB Controls

Thanks,
Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9768374
Also, please maintain your old open questions:

1 06/24/2003 100 VB.Net generated control in VB6.0 projec...  Open VB Controls
2 08/13/2003 200 MDAC_TYP Versions - OK to use 2.7?  Open VB Databases
3 09/18/2003 50 .oca,.lib,.exp files... do I need to dis...  Open VB Controls

Thanks,
Anthony
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9768377
Sorry about the double post,
Anthony
0
 
LVL 1

Author Comment

by:MushyPeas
ID: 9768443
Thank you sirbounty.. sometimes you just can't see for looking!

Acperkins: I'll look at my old posts.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 9768578
I only know because I was in the same 'zone' a few months back!  :-)
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

732 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