Solved

Format Currency with no decimal places eg $1000

Posted on 2003-11-17
6
2,328 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
  • 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now