Format Number to Two Decimal Places (Ex: 100.38)

# Thread: Format Number to Two Decimal Places (Ex: 100.38)

1. Junior Member
Join Date
Dec 1969
Posts
17

## Format Number to Two Decimal Places (Ex: 100.38)

Trying to format a sum of numbers into Currency with 2 decimal places. <BR><BR>strS7GTAcres = strS7Acres1 + strS7Acres2 + strS7Acres3<BR>strS7GTCAUV = strS7CAUV1 + strS7CAUV2 + strS7CAUV3<BR>strS7PerCAUV = (strS7GTCAUV / strS7GTAcres)<BR><BR>Acres are CDbl(Request.Form("...))<BR>CAUV is CCur(Request.Form("...))<BR><BR>If my strS7GTAcres = 300 and my strS7GTCAUV = 350<BR>my strS7PerCAUV = 1.16666666666667<BR>I need it to = \$1.17<BR><BR>Any help will be appreciated! :o)<BR><BR>P.S. If you are out there, Russell M, do you have an answer on this one for me? :o)

2. Senior Member
Join Date
Dec 1969
Posts
1,316

## Several ways

If you are dealing with money, this is very easy:<BR><BR>CCur(Value) converts a value to type Currency<BR>FormatCurrency(Value) is a *display* function that adds the dollar sign and has 2 decimal places.<BR><BR>You can also use FormatNumber function. (Just google for this one)

3. Junior Member
Join Date
Dec 1969
Posts
17

## RE: Several ways

Thank you, thank you, thank you, Jason! This appears to do the job. This is such a great forum ... :o)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•