.net - How to show the answer once the answer is over 2 decimal places -


Text after "

I have a visual basic calculator that calculates the amount of a cone.

I have two answers, one mm in the cube and the second cubed meter (which is the round for the nearest hundred (2 decimal places)). But I want to show only cubed meters once it reaches 0.01 or higher.

My calculation code here

  Private subtxtSidea_Leave (ByVal is used as the object, byVal E, System.EventArgs) handles txtHeight.Leave, txtRadius .Leave 'V calculate using quantity cubic mm = 1/3 exemplary R * 2 * H const PI double = System.Math.PI lbAnswerlVolumeMM.Text = (1/3 * PI * ((Val (txtRadius. Text) ^ 2) * Val (txtHeight.Text)) ToString ("#") + "Cuibic mm" 'calculate the volume cubic meter using V = 1/3 exemplary R * 2 * H / 10 ^ 9 lblAnswerVolumeMetres.Text = ((1/3 * PI * (((txtRadius.Text) ^ 2 ) * Val (txtHeight.Text))) / 10 ^ 9) .toString ("#. ##") + ": cubic meter" end sub   

will be an example; Height 50 mm and radius 30 mm which will be 47124 mm cube output which is good. But this meter does not show anything for the cube, so if the answer to the meter cube is less than 0.01, I would like to hide this label until it is greater than 0.01 and then displays the result. Try it:

Try it:

  private subtxtSidea_Lave (the form of the object In-by-side sender, System byVal e.AventArgs) handles txtHeight. , Using TxtRadius.Leave 'Volume Cu Meter V = 1/3 PR R * 2 * H Construct PI like double = system.math.pi lbAnswerlVolumeMM.Text = (1/3 * PI * (((txtRadius.Text ) ^ 2) * Val (txtHeight.Text)). Calculation of quantity cubic meter using ToString ("#") 'V' = 1/3 exemplary R * 2 * H / 10 ^ 9 lblAnswerVolumeMetres.Text = ((1/3 * PI * ((Val (TSTDS test) ^ 2) * Wall (TCThete text))) / 10 ^ 9). String ("#. ##") - Check that if the LBALSwirevolume metres text and text; = 0.01 then lblAnswerVolumeMetres.Visible = True lbAnswerlVolumeMM.Visible = False Else LLL AnswersVolumeMetres.Visible = False lbAnswerlVolumeMM.Visible = True End if '- the details of the details are made after the decision is made on the basis of the number. LblAnswerVolumeMetres.Text & amp; = ": Cubic meter" lbAnswerlVolumeMM & amp; = ": Cubic meter" end sub    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -