Solved

Rouding a Double Value

Posted on 2006-07-17
2
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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