Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The percentage (%) in textbox??? 1

Status
Not open for further replies.

mimosa

IS-IT--Management
Apr 4, 2002
25
US
Hi!
Please, how can I make the percentage (%)in a textbox?
 
The question is not clear.
If you want the % sign to appear on the side of the text box to make the user realise, then, you can create a textbox adjacent to the one where the value is displayed and enter the VALUE of the percentTextBox to "%". You can suitably size it. Also in the percentTextBox.When evet. put the code RETURN .f. This will ensure that the text box will noever get the focus. I am suggesting this as against a lebel, since the label cannot be easily matched in height to that of textbox though the backcolor can be manipulated (the visual effect will not be good).
ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
On the other hand, if you want something like '15.1%' to appear inside the textbox myTextBox when the data, myNumber = .1513, then simply do something like:

Code:
 thisform.myTextBox.caption = STR(myNumber*100,1 ) + "%"
thisform.refresh

There are some details like scientific notation you might have to handle, but this should get you started.

Dave Dardinger
 
Actually I should have tried it out before posting, I left out the number of places to display (decimal point counts as a place) so it should be STR(myNumber*100, 4,1)

Dave Dardinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top