• Status: Solved
• Priority: Medium
• Security: Public
• Views: 507

# Limit Currency to 2 decimal place

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
trowa
• 2
1 Solution

Commented:
a=format(352 * 242/ 25.5252,"#,#0.##")
0

Commented:
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

Commented:
it depends on whether to display 0 cents or not. both the formats will give result.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

## Featured Post

• 2
Tackle projects and never again get stuck behind a technical roadblock.