Formatting decimal places...

I have an application which pulls data (a currency amt) from an Access db. The number is a subtotal from a purchase. This number has 2 decimal places which is correct for currency.

The application then performs some functions to display the tax amount and then another function to display the total amount due. The tax and total due figures both have 3 decimal places, obviously a result of the mathematical functions being performed on them.
I am presenting these numbers in the form of a label on my form. I know this is silly but how can I present the tax and total due figures with only 2 decimal places?
11/15/2003 7:37:40 PM 2237 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 3


This FAQ might help:
11/16/2003 12:33:07 PM
I am using web matrix and I have a page which displays a net amount taken from a table in a database. What I would like to do now is display the tax amount and the grand total but don't know where to start. 

I would like to display them as a label on my form - can you help ? Do I need to calculate the tax and total within the database first or can i write code to generate it by taking the displayed field and calculating the tax and then adding the field to the label to give a grand total in another label?
Hope you can help thanks - phil
6/15/2004 4:40:27 PM

Similar Artilces:

Formatting a decimal to 2 decimal places
Hi - just testing some code, and the code below returns a number with 3 decimal places (eg. 450.000). Will returning a decimal always give 3 decimal places, and if so, how can I remove the last one? I don't want to use: Return String.Format("{0:C}", decRunningTotal) - as that will automatically add a $ or £ or whatever to the start, and I'd like to control that. I'd really appreciate any help, thanks, Mark Function GetItemTotal() As String objDT = Session("Cart") Dim intCounter As Integer Dim decRunningTotal As Deci...

VS.NET cannot detect Web Matrix web server
I'm running VS.NET 2003 on XP Home, so I have Web Matrix installed as a web server (I don't have IIS).I wanted to create my first web application with VS.NET, but when I select New Project -> web application I get the following message:VS.NET cannot detect a web server running 1.1... etc.I have the NET framework installed (SDK). Also I notice that I do not have a web server icon in my system tray. Do I have to do something to configure or enable Web Matrix web server (I only installed it).Many thanksChris Hey,VS.NET 2003 requires IIS; Web Matrix local web serve...

C#.NET in VS.NET vs. C# in Web Matrix
Hi all, I am very new to .NET ... I realized C#.NET is only available from Visual Studio.NET ... however, I realized Web Matrix also allowed us to choose C# as language but not C#.NET ... they are not the same, right? If not, then why it's in Web Matrix which runs ASP.NET?? If I need to run C#.Net, I MUST GET VS.NET, right? Can C#.NET has the abality to create chat program? Thank you very much. C#.NET and C# are the same thing. JimMS MVP ASP.NET [VC++/MFC emeritus]Old Dog Learns New TricksPreferred programming language: cuneiform on clay tablets So ... that means I can use web matrix t...

Using web matrix web server with Visual Studio .NET 2003
Hello all, I am a computer system technology student and my college is a part of the MSDN Academic alliance, so I managed to recieve an educational copy of Visual Studio.NET 2003. Seeing as I am on a work term and actually have free time at night... I have decided to punish myself and learn another technology. My problem is that I am running it on a Windows XP Home edition system at home, so I cannot run IIS. I do have the professional CD, also from MSDN acdemic alliance, but, 1) I may someday use my XP Home to produce comercial solutions in HTML, PHP, JSP or other (though I'll pr...

possible to use both and web matrix for web application development?
Hello there, i am wondering will it possible to develop a web application using a mixture of web matrix and VS.NET? Say for example, on my application, i developing a web service module(both client n web service ) in VS.NET while my teammates is doing their web application module using webmatrix. Once integrated into a system will it work? Do note that these modules dont share the same data, hence no data exhange will occur. Both the application will be using VB.NET as well. Pls someone answer my doubts, thanks! If you do component programming ofcourse yes. it is like one ...

Format decimal places
I have the following expressiona3 = GetNomBal(period, "40011") GetNomBal is a function which returns a "double" value, I want a3 to display at all times as with two decimal places, at the moment if the function returns 361.23 then a3 displays as 361.23 which is what I want, But if the value is say 200.00 then it displays 200 I tried a3 = Format(GetNomBal(period,"40011"),currency) but got an error. Can anyone help Thanks :)Ben Durkin MCP MCSA MCSE, Currently learning VB.NET and ASP.NET Burnley, England Try this, MyStr = Format(334.9, "###0.00");My ASP.NET blog ~God doesn't play dice....

after installing web matrix VB.NET web page don't work
I just started with ASP.NET in VB.NET. I had developed a simple web page and it worked fine. Then I installed web matrix and started playing with it. When I go back to VB and try to run the program (that worked before) I get an error: "Unable to start debugging on the web server. Could not start ASP.NET or ATL server debugging." How do I get VB.NET to working again? I'm not sure why your existing Web application don't work after the installation of Web Matrix, as they can live without conflict in fact, did you try to look for an answer from the about the ...

How to format a string of percentage format to decimal format ?
How to format a string of percentage format to decimal format ? 1    orginalValue  // value will be 1265.48 2    percentString // value after applying percentage format will be 126548 %3    requiredvalue // value should be 1265.48  I converted the string from orginalValue to percentString, now i need to convert back to requiredvalue. Is there any way to do ? regards, Ananth RM -  string percentString="126548 %";double value=double.Parse(percentString.Replace("%","").Tri... and web matrix
do these applications work together? if i have can share work with someone using web matrix? how would i get the web matrix projects into my project? I don't think webmatrix supports code behind files. I am not sure on thsi as I have never really used it myself. I am also unsure if webmatrix uses sln files like visual studio does. I always thought that webmatrix ran the SDK and followed the same setup as it as far as what files and what type of files it supports. You could get someone working on either one to collaborate on a project, it just won't be as easy as...

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

Web Matrix and IIS. Page is not opening from Web Matrix. HELP!!!
Hi, I am running XP Pro with IIS + Web Matrix. I used all tips for fixing .NET in Web Matrix (XML config tips). When I am testing pages from Web Matrix http://localhost:8080/test.aspx nothing shows up in a browser. It is just white. However if I select Open in Web Browser from Web Matrix browser shows directory listing with all files. Once I click on one of those files again nothing happens. My configuration: Win XP SP1 with IIS running, Hardware router D-Link for sharing cable internet connection between 3 computers (port 8080 is open). Is it possible to get Web Matrix server to ...

formating decimal places in a dataset
I am pulling a decimal value and then exporting it to a textfile. I know how to format if I was doing it on a webform - no prob, but pulling the info otherwise is causing me some problems and I was wondering if anyone can help Sample Code: Dim numberPlaceHolder as string Dim iLoop as int Dim dataSet1 as dataset .... fill dataset1 .... For iLoop = 0 To dataSet1.Tables("tmpDecimal").Rows.Count - 1 numberPlaceHolder = dataSet1.Tables("tmpDecimal").Rows(iLoop).Item(1) Next the numberPlaceHolder needs to be formate...

Web Matrix and .NET 2
Hi Dear Web Matrix Team, Even if it is a little premature, could it be possible to have an idea of the compatibility between the current Web Matrix release (0.6) and the coming .Net Framework 2 (beta) ? Thanks, jim. Hi, Some news about the next release of the .NET 2 Framework can be found here : Amazing new features are on the way, hope that a new Web Matrix will follow. Jim Some news here: ...

Web Matrix with .net 2003
Does web matrix work with visual studio version 2003 and .net 1.1? Thanks. The newest version of the web matrix does. It works swell. ;) JasonJason N. GaylordASPInsider and Microsoft MVP

Web resources about - Formatting decimal places... -

Wikipedia:Manual of Style/Text formatting - Wikipedia, the free encyclopedia
The most common use of boldface is to highlight the article title, and often synonyms, in the lead section (first paragraph). This is done for ...

Formatting « Above the Law: A Legal Web Site – News, Commentary, and Opinions on Law Firms, Lawyers ...
Above the Law: A Legal Web Site – News, Commentary, and Opinions on Law Firms, Lawyers, Law School, Law Suits, Judges and Courts

Android Studio 1.2 Reaches Beta, Adds Built-In Decompiler, Inline Debugger Variables, Smarter Formatting ...
When Android Studio v1.1 entered the Stable channel, about 6 weeks ago, the Dev Tools team gave word that v1.2 was already well underway and ...

TextExpander 2.0 Brings Rich Text Formatting, Fill-In Snippets And More
TextExpander has finally received its big 2.0 update.

WordEver HD - Text Editor with Redesigned Keyboard and MarkDown syntax & formatting highlight
Holen Sie sich „WordEver HD - Text Editor with Redesigned Keyboard and MarkDown syntax & formatting highlight“ im App Store. Sehen Sie sich Screenshots, ...

Macs are vulnerable to Thunderstrike 2 firmware malware that survives formatting
... Thursday, researchers will demonstrate that not only can Macs be remotely infected with malware, but that this malware can survive a user formatting ...

16 Tips on Blog Writing and Formatting
... again. My point is that you ought to take advice with a grain of salt. And that applies to this post as well. Writing blog posts and formatting ...

Select Text With Similar Formatting in Google Docs
Google Docs added a cool new feature that lets you select all the text with similar formatting, so you can quickly make some changes. It's like ...

Resources last updated: 1/15/2016 3:17:24 PM