Solved

User-Defined Numeric Formats

Posted on 2004-10-11
2
379 Views
Last Modified: 2006-11-17
Hi:
     Can someone give me information plus examples on how to use User-Defined Numeric
Format functions in Visual Basic 6?
0
Comment
Question by:LearningJava
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 200 total points
Comment Utility
0 stands for a digit
# stands for a digit, except for leading or trailing zeros
. is the decimal placeholder, regardless of region
, separates the thousands, regardless of region

The actual printed decimal and thousands separators ARE regional.

other characters are printed as is.

Format(8315.4, "00000.00") gives  08315.40
Format(8315.4, "#####.##")         8315.4
Format(8315.4, "##,##0.00")        8,315.40
Format(315.4,"$##0.00") $315.40  
0
 
LVL 19

Assisted Solution

by:Shauli
Shauli earned 200 total points
Comment Utility
...and:

MsgBox FormatNumber(x, 2)   'will format number with the required decimals after the decimal sign = 1,255,666.25
MsgBox FormatPercent(x, 2)    'will format a number as a percent (times 100 and % sign)  = %59.25
MsgBox FormatCurrency(x, 2)   'will format number as a currency  =  $1,255,666.25


S
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

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

18 Experts available now in Live!

Get 1:1 Help Now