Solved

textbox formatting

Posted on 2004-09-09
6
350 Views
Last Modified: 2010-04-17
hi

 in a form i have a texbox with is getting populated when page is displayed. it is displaying something as

12.0000.

but in the textbox i want only 12.00 ( with only two digits after decimal point to be displayed). how to format it.

thanks
sandeep
0
Comment
Question by:sandeep437
  • 2
6 Comments
 
LVL 5

Expert Comment

by:brianb99999
ID: 12022228
Depends on the language.
In MS Access or a bound control in other languages look for:
DataFormat or Mask or Format properties and modify these to #0.00

If it is not bound then when you get the data from wherever but before you assign it to the textbox use something like:
textboxname.text = format("12.0000", "#0.00")

Brian.
0
 

Author Comment

by:sandeep437
ID: 12022384
textboxname.text = format("12.0000", "#0.00")
is not working.

i working in vb.net.

can anybody tell formatting in vb.net
0
 
LVL 5

Accepted Solution

by:
brianb99999 earned 125 total points
ID: 12022579
= Format(CDbl("12.0000"), "#0.00")
0
 
LVL 5

Expert Comment

by:tzxie2000
ID: 12022959
code below
        Dim d As Double

        d = 12.0000
       textbox.Text = Format(d, "#0.00")
        Dim s As String
        s = "12.0000"
        textbox.Text = Format(CDbl(s), "#0.00")

if your input is an double variant use d mode
if your input is an string variant use s mode

all of them use format function
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now