How to Format Decimal Places in Visual Basic
- 1). Click the Windows "Start" button and select "All Programs." Click "Microsoft .NET Framework," then click "Visual Studio." Open your VB project.
- 2). Double-click the form you want to edit. Double-click the control on the form that contains your decimal number. The code editor opens to the control's source code.
- 3). Type the following code to format the decimal:
textbox = FormatNumber(decimal_number, 5)
In this example, a decimal number is formatted to five decimal places and the result is displayed in a Visual Basic text box.
Source...