0

I'm new to complex maths and equations in vb, even the basic maths below does not work correctly.
So can any one advise on the best data for for me to use e.g. below decimal for math calcs
Help me put the below correct.

Private Sub z()

    Dim ringheight As Decimal
    ringheight = CType(Me.txtringheight.Text, Decimal)
    Dim slope As Decimal
    slope = CType(Me.txtangslope.Text, Decimal)
    Dim siloring As Decimal
    siloring = (Convert.ToDecimal(cbosilorings.Text))
    Dim silodia As Decimal
    silodia = (Convert.ToDecimal(cbosilodia.Text)) / 2

    lbzh.Text = (siloring * ringheight) + ((silodia / 2) * Math.Tan(slope))
End Sub

Cheers
Ross

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Reverend Jim
0

It's always a good idea to state specifically what you are trying to do. What you have done is say that you are trying to do some math, then shown us uncommented code. Having said that, I would use double rather than decimal.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.