Solved

textbox formatting

Posted on 2004-09-09
6
343 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
Comment Utility
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
Comment Utility
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
Comment Utility
= Format(CDbl("12.0000"), "#0.00")
0
 
LVL 5

Expert Comment

by:tzxie2000
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countHi challenge 25 84
changePi Challenge 15 75
endX challenge 2 48
Help to convert powershell script into a gui 9 66
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 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

12 Experts available now in Live!

Get 1:1 Help Now