Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

User-Defined Numeric Formats

Posted on 2004-10-11
2
Medium Priority
?
398 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
[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
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 800 total points
ID: 12277280
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 800 total points
ID: 12277466
...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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 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…
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…
Suggested Courses

636 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