Home > Software engineering >  VB how to make the textbox calculation numerical display only two valid decimal?
VB how to make the textbox calculation numerical display only two valid decimal?

Time:10-09



as shown in figure: how to make a textbox calculation show only two ?

CodePudding user response:

The Format () function,

CodePudding user response:

reference 1st floor of123 response:
Format () function,



Specific how to do? Add a losing focus process??

CodePudding user response:

Are you input, or show?

CodePudding user response:

reference of123 reply: 3/f
are you input, or show?


, according to the above the green text box is calculated values, make the numerical display only two decimal places,

CodePudding user response:

After the calculation show that when added:
Textbox1. Text=format (textbox1. Text, "# # # 0.00")

CodePudding user response:

Text1=Format (your_result, "0.00")

Note that there is a round,
  • Related