Solved

Limit Currency to 2 decimal place

Posted on 2002-03-25
3
483 Views
Last Modified: 2007-11-27
How to limit Currency to 2 decimal place?

Here is an Example.

Dim a As Currency

a = 352 * 242/ 25.5252

The a will return more than 2 decimal place, how to limit it to just 2 decimal place?

Thanks
0
Comment
Question by:trowa
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
appari earned 50 total points
Comment Utility
a=format(352 * 242/ 25.5252,"#,#0.##")
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
appari,
   if you want to be sure that you ALWYS get the cents, then the format should be:

a=format(352 * 242/ 25.5252,"#,##0.00")

the .## notation will drop trailing 0's , using a 0 in the formatstring FORCES a zero in that place, no matter what.

0
 
LVL 39

Expert Comment

by:appari
Comment Utility
it depends on whether to display 0 cents or not. both the formats will give result.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

762 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

6 Experts available now in Live!

Get 1:1 Help Now