Display 1.50 and not 1.5 
Author Message
 Display 1.50 and not 1.5

Hi all,

How may I force a text field in Visual Basic 4.0 to display a numeric
value as 1.50 and not 1.5?

The field is connected to an Access 7.0 table. In the Access form it
works fine.

Thanks fpr any help
Thomas Spiess



Tue, 13 Apr 1999 03:00:00 GMT  
 Display 1.50 and not 1.5

Hi Thomas.

You need to use the Format function to do this. For example:

Sub Text1_Change
  Text1.Text = Format$(Text1.Text,"0.00")
End Sub

Check out VB Help on the Format function for other formatting tips.

Let me know if I can be of any more help.

=========================================
"When the going gets tough, the weird turn pro."
         -- R. Duke


=========================================


Quote:
> Hi all,

> How may I force a text field in Visual Basic 4.0 to display a numeric
> value as 1.50 and not 1.5?

> The field is connected to an Access 7.0 table. In the Access form it
> works fine.

> Thanks fpr any help
> Thomas Spiess



Tue, 13 Apr 1999 03:00:00 GMT  
 Display 1.50 and not 1.5

Quote:
>How may I force a text field in Visual Basic 4.0 to display a numeric
>value as 1.50 and not 1.5?

How about
    Text1.Text = Format$(x,"0.00")

Hope this helps.

-Anton



Tue, 13 Apr 1999 03:00:00 GMT  
 Display 1.50 and not 1.5

Quote:
>Hi all,=20
>=20
>How may I force a text field in Visual Basic 4.0 to display a numeric =20
>value as 1.50 and not 1.5?=20
>=20
>The field is connected to an Access 7.0 table. In the Access form it =20
>works fine.=20
>=20
>Thanks fpr any help=20
>Thomas Spiess=20

=20
Try this:=20
=20
=09Dim fValue As Single=20
=20
=09fValue = 1.5=20
=20
=09Text1.Text = Format$(fValue, "0.00")=20
=20
=20


Wed, 14 Apr 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VB5EE setup wizard and mdac 1.5 (ado 1.5) problem

2. Help; Centura 1.5, CDO

3. MBasic 1.5

4. TURBO*LIBRARY 1.5

5. LDAP connection with ADO 1.5

6. OsloData 1.5 :New DB SHAREWARE

7. QuickFORM 1.5 now shipping

8. Announcing WinBrowse 1.5 - Multi database utility and browser

9. NewWorld3D 1.5 OCX update - screen shots

10. ADO 1.5 CMD error when executing Stored Procedures??

11. ActiveExec 1.5 Released!

12. ActiveExec 1.5 - Need Beta Testers!

 

 
Powered by phpBB® Forum Software