Roundin' Dim' Dollars

1. Senior Member
Join Date
Dec 1969
Posts
1,432

## Roundin' Dim' Dollars

ok ...<BR><BR>I have a number .... lets say 8.835<BR><BR>I take this number and put it into a variable ...<BR>curVar = 8.835<BR><BR>Then I convert it to curreny ...<BR>curVar = CCur(curVar)<BR><BR>Then I insert it into a DB ...<BR>....<BR>objcst("Price") = curVar<BR>objcst.update<BR>....<BR><BR>Then I grab that data and print it out on a page ....<BR>Response.Write objcst("Price")<BR><BR>and it is still coming out \$8.835!!!!<BR><BR><BR>I want it to be 8.84 .... shouldnt CCur() take it down to pennies??????

2. Senior Member
Join Date
Dec 1969
Posts
2,809

## FormatCurrency()

That should work for you

3. Senior Member
Join Date
Dec 1969
Posts
1,432

## hrmph ...

that just turns 8.835 into 8.83<BR><BR>=[<BR><BR><BR>I wanted it to be like 8.84

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

## So round it up foist

Round()

5. Senior Member
Join Date
Dec 1969
Posts
503

## use round(intbalh, 2) (eop)

.

6. Senior Member
Join Date
Dec 1969
Posts
1,432

## ok ...

I would do this right ...<BR><BR>Round(curVar, 2)<BR><BR>and that would take it to 2 decimal places?

7. Senior Member
Join Date
Dec 1969
Posts
1,432

## that ...

is still giving me 8.83 ...<BR><BR>I am doing ...<BR><BR>Round(curVar, 2)

8. Senior Member
Join Date
Dec 1969
Posts
2,809

## Huh...

I just tried it and it rounded...<BR>str1 = "83.456"<BR><BR>response.write formatcurrency(str1,2)<BR><BR>came back with \$83.46

9. Senior Member
Join Date
Dec 1969
Posts
1,432

## RE: Huh...

yeah but you have that <BR><BR>formatcurrency(var, 2)<BR><BR>you OBVIOUSLY saw I didnt have the "2"<BR><BR>so dont say "huh?" like i missed something that was totally obvious

10. Senior Member
Join Date
Dec 1969
Posts
1,432

## btw ...

STILL doesnt work ...<BR><BR>might also look that you had 83.456<BR><BR>notice the "6"<BR><BR>i have a "5"<BR><BR>duh

#### Posting Permissions

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