Decimals

I am currently making a quote system that accepts user details and returns a price in pounds. The price is rounded to two decimal places using:

System.Math.Round(theNumber, 2)

But for numbers divisible by 10, the returned result only displays one decimal place.
i.e. Three pounds and twenty pence is displayed as:


£3.2     rather than     £3.20

Can anyone offer any help as to how I can force the result to always display two decimals?

Any help would be most appreciated.
0
duncanhall
7/13/2006 4:13:25 PM
asp.net.visual-basic.net 3721 articles. 0 followers. Follow

2 Replies
674 Views

Similar Articles

[PageSpeed] 7

Try this....

String.Format("{0:n}", System.Math.Round(theNumber, 2))

0
alcsharp
7/13/2006 9:43:32 PM
Excellent, just what I needed!

Thanks.
0
duncanhall
7/14/2006 10:17:00 AM
Reply:

Similar Artilces:

Visual Basic.NET or Visual Studio.NET?
OK, this has probably been asked before... I'm a student looking to cut my costs, and I can do this by just purchasing Visual Basic.NET as opposed to the fully-fledged Visual Studio.NET application. Of course, I'll only be able to program in VB, but that's fine with me. I wanted to know if all of the ASP.NET specific options are available, such as using a WYSIWYG editor? I'd also like to know if VB.NET has IntelliSense, or that's a specific option only available to Visual Studio.NET users. Thanks in advance. I'd have to believe that VB.Net has intellisense. What is the price d...

Visual Studio .Net? Visual Basic .Net?
Okay, I admit it -- I know nothing about .Net. I'm a Visual Basic and ASP developer. DotNetNuke is my first tentative step into the whole ".Net Thing", and I'm looking for some advice... What do I really need to be able to make some modifications, or new modules for DotNetNuke? Do I need the full, THOUSAND DOLLAR Visual Studio .Net 2003 package, or can I get away with the HUNDRED DOLLAR Visual Basic .Net Standard package?Chameleon Systems, Inc. You can use webmatrix, available here for free. One of the drawbacks of webmatrix however is that it does not support code-be...

Visual Basic.NET or Visual Studio.NET? #2
I am currently using the Web Matrix to develop ASP.NET applications, but I am keep to upgrade to VS.NET. However, I can't justify spending $1,000 at the moment. I then found the MUCH cheaper "Visual Basic .NET 2003 Standard Edition" which is only $100. I have very little C# knowledge, and use Basic almost all the time. Would this be a good tool to use for web development? Does it support all the code behind stuff that VS users love so much? Thanks!! I use "VB.NET Standard Edition" and I'm happy with it. It has exactly the same features as Visual Studio.NET. Th...

Visual Basic .NET 2003 vs Visual Studio .NET 2003
Hi, If im going to be coding my ASP.NET in just VB.NET then would I be able to go for the cheaper option of buying Visual Basic .NET 2003 ?? - Carl S Yes.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog Are there any limitations if I was doing my ASP.NET with VB.NET in Visual Basic .NET 2003 than if I was using the full Visual Studio .NET 2003 ?? Or are the only advantages of Visual Studio .NET 2003 in that it supports more programming languages ?? - Carl S You should check the MS Web site, but I believe that, given an edition (Standard, Professional...

ADO.NET Programming in Visual Basic .NET
Has anyone read "ADO.NET Programming in Visual Basic .NET, Second Edition" by Steve Holzner (Author), Bob Howell (Author)? I am trying to working on a project and there are a few things that I need to tie up quickly in my web forms. Is this book a good one? karls------------------------------------'Old and wrinkled is not what I expected to become when I grew up!'...

C# Visual Basic.NET JScript.NET what should I choose ?
I'm just a beginner with programing ASP.NET web sistes. Unfortunatelly I don't know any of the languages supported by ASP. (By the time I programmed in DELPHI and SQL) So I should start to learn one of the languages. Could somebody help me to choose the language I should use ? Which and why ? Thanks in advance, Gonzi Use C# or VB.NET, which ever you are comfortable with. Go here to see sample of both in use http://samples.gotdotnet.com/quickstart/aspplus Ultimately, once you get more advanced, you'll really want to become comfortable with both languages. I ...

Converting Visual Basic 6 to Visual Basic .NET
Hi, I found this program that would get the mac address of a computer given its IP. I converted it into vb.net and it gave 2 errors. It said that I couldn't use "any" in declarations, so I found out what variable it was tryign to pass and changed the any to that data type. Now, the program will start in vb.net... but when I click the button, it returns the wrong mac address, while the one in vb6 returned the correct one.All you have to do is add 2 textboxes to the form and 1 button, dont change their names.::::::::::VB6 CODE::::::::::Option ExplicitPrivate Const NO_ERROR = 0Private Declare F...

Can I go from VS .NET 2003 to Visual Basic .NET 2003?
Hi, I just developed a commercial application using the trial version of Visual Studio .NET 2003.  My trial is about to expire.  I was hoping .NET 2.0 would be released by now, but that is obviously months away so I'm wondering if I could save a few hundred bucks by buying Visual Basic .NET 2003(around $110 i think) instead of having to buy Visual Studio .NET 2003, which I believe is up around $600 or so.   All my code is Visual Basic, so that's why I'm thinking that's all I need.  And it's mostly web development that I do if that matters.  T...

Visual C#.Net vs Visual Studio.Net
I have read in other posts a lot of people recommending Visual Studio.Net over the Web Matrix. My query is: why is there a £700 difference between VS.Net and Visual C#.Net? As a c# developer, I won't need any VB functionality. I also don't require Visual Source Safe, as projects are generally small and manageable. What features are lacking in Visual c#.net that justifies the price difference? Does it have Intellisense / Dubuggers / Compilers? These are the features that would make me pay for it instead of continuing with WM, but I need to know if tehre is serious functionality missin...

What are the diff. visual basic 6 and vb.net ? How to convert the VB6 project to vb.net proj ?
What are the diff. visual basic 6 and vb.net ? How to convert the VB6 project to vb.net proj ? with code and interface too. There are entire forums dedicated to the differences between the two, and to convert your projects you should try the upgrade wizard in Visual Studio....

Free Book
followup to grc.techtalk Free Book - Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET http://msdn.microsoft.com/vbrun/staythepath/additionalresources/upgradingvb6/ ----------------------------------------------------------- Quote ----------------------------------------------------------- Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET is is the complete technical guide to upgrading Visual Basic 6 applications to Visual Basic .NET, covering all upgrade topics from APIs to ZOrders. It shows how to fix upgrade issues with forms, language, data...

Can I install Visual Basic 6 on my machine which has VS.NET 2003 & VS.NET 2005?
I may have a need to use Visual Basic 6 for a legacy project in the near future.  I was wondering if I can install VB6 on my machine which already has VS.NET 2003 & VS.NET 2005 installed on it? I did not know if doing so would cause issues or not so thought I would ask before just leaping and doing.   Ira Richard Smith At one time i had to install Visual Basic 6 on my machine with VS.NET 2003 and had "NO" issues. I would suggest take a backup of your machine or a restore point before you proceed. Please post your experience. I am sure some one would appreci...

Net:Net:Net::LDAP::FAQ
------_=_NextPart_001_01C6429F.D89AA417 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Net::LDAP Net::LDAPS Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, ....) password? I don't like to write the secret password to the perl file. Best regards Barbara Wilbert ------_=_NextPart_001_01C6429F.D89AA417-- Wilbert Barbara (CI/OSI) * wrote: > Hello, > > Net::LDAP > Net::LDAPS > > Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, > ......

Visual Studio .NET vs Visual Studio .NET 2002 or 2003?
As an admin, I'm working to determing what systems I need to update with the update on MS08-017, particularly with respect to Visual Studio .NET 2002 and 2003. I've got quite a few systems that appear to have Visual Studio .NET, no 2002 or 2003 mentioned when I view what's there in Add/Remove Programs. Is there a definitive way to determine if I have a 2002 or 2003 version?   sandy_wood:Is there a definitive way to determine if I have a 2002 or 2003 version? In add/remove programs it would indicate it VS2003 as Visual Studio 2003. Alternatively launch the applicatio...

visual studio.net 2003 conflict visual studio.net 2003
hello does visual studio.net 2003 makes conflict with visual studio.net 2003? thank you for the help and for the support No, the RTM version (I think this is true also for Beta 2), will work on the same machine without any problems./Fredrik Normén - fredrikn @ twitterMicrosoft MVP, MCSD, MCAD, MCTASPInsidersMy Blog i am shure 2003 doenst conflict with 2003 ;-)-Hanneshttp://www.preishuber.net http://weblogs.asp.net/hpreishuber the subject says "visual studio.net 2003 conflict visual studio.net 2003". is he talking about 2003 and 2005 ? pradeep_TP I think he is talking abo...

Web resources about - Decimals - asp.net.visual-basic.net

Penny (Irish pre-decimal coin) - Wikipedia, the free encyclopedia
The penny (1d) ( Irish : pingin ) coin was the third smallest denomination of the pre-decimal Irish pound , worth 1/240 of a pound or 1/12 of ...

Dewey Decimal Classification - Wikipedia, the free encyclopedia
This highly organized system categorizes books on library shelves in an efficient, specific and repeatable order that makes it easy to find any ...

4th Grade Splash Math Worksheets to learn decimal numbers, multiplication, division & fractions for kids ...
Get 4th Grade Splash Math Worksheets to learn decimal numbers, multiplication, division & fractions for kids on the App Store. See screenshots ...

Dewey Decimal Tattoo - Flickr - Photo Sharing!
Children's librarians represent.

Math of the Day: Sesame Street’s The Count Reads Pi to 10,000 Decimal Places
... has created a true monster out of your favorite Sesame Street vampire, with audio of The Count reading every digit of Pi out 10,000 decimal ...

Paul Harapin heads Decimal Software after VCE ousting
Former VCE Asia-Pacific boss, Paul Harapin, has taken over as CEO of Decimal Software.

Feeling green: the dangers of decimal currency
The curious case of possibly toxic coins, via Austria and a devastatingly original idea for Canberra.

Jobless Rates With Another Decimal
The BLS reported a jobless rate of 8.3% for both January and February. Adding an extra decimal, the unemployment rates would actually be 8.26% ...

JPMorgan Sued by Trader Over $3 Million Decimal Point
JPMorgan Chase & Co. is being sued by a trader who says he accepted a contract from the investment bank because a typographical error made him ...

.Decimal Archive - Houston Gamer
It was only back in August when newly-formed Houston game studio Orb Interactive launched a Kickstarter campaign for “.Decimal”, a sci-fi take ...

Resources last updated: 1/12/2016 9:37:27 AM