Solved

Rouding a Double Value

Posted on 2006-07-17
2
204 Views
Last Modified: 2010-04-23
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...
0
Comment
Question by:foobarr
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
ID: 17121722
Hi foobarr,

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

Tim Cottee
0
 
LVL 7

Author Comment

by:foobarr
ID: 17121727
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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question