Solved

textbox formatting

Posted on 2004-09-09
6
357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn different types of Android Layout and some basics of an Android App.
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 …
Simple Linear Regression

724 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