Rouding a Double Value

I am having difficulty rounding a number and displaying it the way I wnat it


right now I have

dim pricem as double

I do some calculations using it


then I go

pricem = math.round(pricem, 2)

this will work fine and round the number to two decimal places, but if the number is 111.3 it won't display the extra zero on the end

I then tried going

pricem = formatcurrency(pricem, 2) thinking this would convert it to the currency format (which is what I am trying to represent) but it does not display the extra zero as well....


i'm confused...
LVL 7
foobarrAsked:
Who is Participating?
 
TimCotteeConnect With a Mentor Commented:
Hi foobarr,

pricem = Math.Round(Pricem,2)
Msgbox Pricem.ToString("#.00")

Tim Cottee
0
 
foobarrAuthor Commented:
yah i just got that going right before you answered heh

but I'm gonna use .toString("0.00") instead


thx for the prompt response
0
All Courses

From novice to tech pro — start learning today.