Solved

# Limit Currency to 2 decimal place

Posted on 2002-03-25
488 Views
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
Question by:trowa
[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
• 2

LVL 39

Accepted Solution

appari earned 50 total points
ID: 6893626
a=format(352 * 242/ 25.5252,"#,#0.##")
0

LVL 44

Expert Comment

ID: 6893742
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

ID: 6895332
it depends on whether to display 0 cents or not. both the formats will give result.
0

## Featured Post

Question has a verified solution.

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

### 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…
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…
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
Course of the Month9 days, 4 hours left to enroll