|
-
Mar 13th, 2015, 09:34 AM
#1
Thread Starter
New Member
[RESOLVED] Converting from Decimal to Unsigned Decimal
I'm completely new to al this but I'm currently trying to calculate an equation in visual basic but I want the answer to always be positive and a decimal. This is my code so far:
[CODE]
Public Class Recycling_Cost
Private Sub btnAns_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAns.Click
Dim sngNum1 As Single
Dim sngNum2 As Single
Dim sngNum3 As Single
Dim sngNum4 As Single
Dim sngNum5 As Single
Dim sngNum6 As Single
Dim sngNum7 As Single
Dim sngAns As ULong
sngNum1 = Val(txtNum1.Text)
sngNum2 = Val(txtNum2.Text)
sngNum3 = Val(txtNum3.Text)
sngNum4 = Val(txtNum4.Text)
sngNum5 = Val(txtNum5.Text)
sngNum6 = Val(txtNum6.Text)
sngNum7 = Val(txtNum7.Text)
sngAns = ((sngNum1 * sngNum2 - sngNum3) * sngNum4) - (sngNum5 * sngNum6 * sngNum7)
lblAns.Text = sngAns
End Sub
Can anyone tell me how to fix this?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|