?
Solved

Format Currency with no decimal places eg $1000

Posted on 2003-11-17
6
Medium Priority
?
2,342 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 200 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

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.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

801 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