Rounding Currency

# Thread: Rounding Currency

1. Junior Member
Join Date
Dec 1969
Posts
6

## Rounding Currency

I am looking for a way to round currency(using FormatCurrency) to the HIGHEST next dollar. Anyone have a simple way to do this? Thanks. Mark

2. Senior Member
Join Date
Dec 1969
Posts
11,334

## RE: Rounding Currency

Are you saying if it&#039;s \$1.01 you want it to equal 2?<BR><BR>If so, I don&#039;t think you can use Round().<BR><BR>Try doing something like this:<BR><BR>myCurrency = Int(myCurrency) + 1<BR><BR>This will truncate the value and add one up on it. You&#039;ll have to throw an if statement in there to see if there is any fractional value before you&#039;d execute this, since you probably wouldn&#039;t want to round up 2.00.

3. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## RE: Rounding Currency

as in if it is \$12.10 you want 13???<BR><BR><BR>

4. Junior Member
Join Date
Dec 1969
Posts
6

## RE: Rounding Currency

That is correct. If it is \$12.01, then I need to round up to \$13.

5. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## Many ways actually

but off the cuff try this<BR><BR>a = "12.00"<BR>If CLng(Mid(a, InStr(1, a, ".") + 1)) &#062; 0 Then<BR>a = Int(a) + 1<BR>End If<BR><BR><BR>should work unless i made any silly mistakes that i am famous for.<BR>

6. Junior Member
Join Date
Dec 1969
Posts
6

## RE: Rounding Currency

Thanks for the response. It worked. This is the statement I used to get my results:<BR><BR>FormatCurrency(Int(rsCatalog("Cost ")) + 1)<BR><BR>I appreciate the help.<BR><BR>Mark

7. Junior Member
Join Date
Dec 1969
Posts
6

## RE: Many ways actually

Thanks for the response. Here is what I used to solve my problem:<BR><BR>FormatCurrency(Int(rsCatalog("Cost ")) + 1)<BR><BR>Thanks again.<BR><BR>Mark

8. Senior Member
Join Date
Dec 1969
Location
Los Angeles, CA
Posts
21,192

## NOPE...will not work

what do you think will happen if rsCatalog("Cost") returns 12.00??<BR><BR>

9. Junior Member
Join Date
Dec 1969
Posts
6

## RE: NOPE...will not work

You have a point. I will give your if statement a try. From looking at it, it should take care of previously rounded numbers. Thanks for the catch.<BR><BR>Mark

#### Posting Permissions

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