Solved

Format Currency with no decimal places eg $1000

Posted on 2003-11-17
6
2,337 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

856 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