473,624 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Formating a text box

I am being very dumb... I am coverting an invoice value to a decimal and
displaying the result on a VB.net 2003 form. However, I only want to display
the result to 2 decimal places and I am struggling to it - sorry for such an
easy question!

Can somebody advice me how to achieve this?

--
Thanks

Bill Partridge
Nov 7 '05 #1
1 1251
Bill Partridge wrote:
I am being very dumb... I am coverting an invoice value to a decimal
and displaying the result on a VB.net 2003 form. However, I only
want to display the result to 2 decimal places and I am struggling to
it - sorry for such an easy question!

Can somebody advice me how to achieve this?


output = String.Format(" {0:f2}", decimalValue);

If you use {0:f} then the number of decimal places from NumberFormatInf o
is used, if you use {0:c} then it will be printed as a currency value
(including the currency symbol).

Richard
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm
Nov 7 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2209
by: Polar | last post by:
I have a database that stories entries of short stories for a writers website. I can easily input the data into MYSQL but my trouble lies in retrieving the data. the story in just cut and pasted from a WP into the TEXTAREA on the form. When I look at the story in the DB I can see it retains all the paragraph spacing etc. but when I try and read that cell when retrieving data all the text is crammed into one paragrapgh. What am I...
1
1909
by: gevayl | last post by:
Hi, Is it possible to do memo text formating in ms access 2000? I mean like underlining a portion of text in a memo field or a text field? Thank you.
0
1156
by: Dmitri Manushin | last post by:
Hi all, i have textBox (multiline) i'am enter many words and don't push enter next i push button and text record in database. When i read data from database in table i'am use teg <pre> for save text formating, but i don't push enter in previous example and my table grow in right. How i can solve my problem. Thanks. P.S.
6
8345
by: Scott Natwick | last post by:
I'm trying to send an email from a Form. Here's what I have so far: MailMessage mail = new MailMessage(); mail.To = "me@mycompany.com"; mail.From = "you@yourcompany.com"; mail.Subject = "this is a test email."; mail.Body = "Line 1"; mail.Body += "Line 2"; mail.Body += "Line 3"; mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","1"); //basic authentication...
4
1573
by: djc | last post by:
Is there a property or method of the textbox web server control that I can use to format the text in it a certian way. For example I am displaying a date value from a database in a text box. It displays like so: mm/dd/yyyy mm:hh:ss. I 'was' using the .ToShortDateString() function like so: txtETA.Text = drMain.Item("EstimatedDeliveryDate").ToShortDateString() which worked great until I came across a database record with NULL for this field....
3
1420
by: Tina | last post by:
I have a datagrid where I specified {0:###,###,###} at design time. However sometimes I am putting percentages in the grid instead of money and I want to change the formating to {##%}. I've looked over the docs on such things as the dataformatstring porperty of the boundColumn but still can't figure out how to do it in code. Thank, T
1
1193
by: Hardik Shah | last post by:
Hi, I want to use various formating on text box , like text box gets only neumeric value, or text box can get only no of character. etc. Any hints will be sincerely appreciated. Hardik Shah.
0
1879
by: musawer | last post by:
Can Someone give a good link for C# Winform DataGrid Text Style Formating (Font,Color,Size etc)... Quick reply will be highly appreciated... Thanks...
12
1852
tolkienarda
by: tolkienarda | last post by:
hi all I am working on a content management service and i need some help keeping formating. what i am doing is recreating my site in an admin side and all of the articles on the site will now be in <textarea> boxes so admins can edit them and save the changes it is working but any formating they use dosen't seem to work. if they want to have a return in the middle of their article the only way it will work is if they enter a br tag in...
1
2544
by: Shawn Northrop | last post by:
I just read an article on kirupa.com about incorporating mySQL and PHP with flash. I am dynamically loading conent into a flash movie and am not sure how to format. In my php code i have: $y = ""; foreach($result as $x){ $y = $y . $x . " "; } print "myVar = $y"; In short $result is a query and $y is the value i will be passing along to flash. the statement $y = $y . $x . " "; puts a space between each name that is passed along. I am...
0
8240
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8625
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7168
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2610
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.