Format Numbers

choudhmh
02-10-2008, 10:27 AM
I have this format button, when you input a value into a textbox and press the button, the value entered on the text box shows up on the text display area within the form:

Private Sub Command2_Click()
Text2.Text = Format(Text2.Text, "000.00")

ConverDigitToLCD Mid(Text2.Text, 1, 1), Digit12
ConverDigitToLCD Mid(Text2.Text, 2, 1), Digit13
ConverDigitToLCD Mid(Text2.Text, 3, 1), Digit14

ConverDigitToLCD Mid(Text2.Text, 5, 1), Digit15
ConverDigitToLCD Mid(Text2.Text, 6, 1), Digit16
End Sub

at present when i enter say 50 in the textbox the display shown is 050.00. But what i nedd is when i enter 50 it should show up like this: 000.50.

Does anyone know how i should format the code in order to achive this.

choudhmh
02-10-2008, 10:59 AM
Sorry found the solution:
Text2.Text = Format(Text2.Text / 100, "000.00")

Thanks

the master
02-10-2008, 10:59 AM
There are 2 ways. Since you are alredy formatting you could remove the decimal point and insert it after the format. The other way is to divide by 100

Edit: Too late. Beat me to it

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum