i'm using this code

If txtCashTendered.Text = "" Then
            MsgBox("Input Amount First!")
            Exit Sub
        End If
        If ctbTotal.Text < txtCashTendered.Text Then
                Dim x
                x = MsgBox("Finalize Transaction?", MsgBoxStyle.YesNo)
                If x = vbYes Then
                    txtCashChange.Text = Format(txtCashTendered.Text - ctbTotal.Text, ".00")
                End If
            Catch ex As Exception
                MsgBox("Create a transaction first!")
                Exit Sub
            End Try

            MsgBox("The amount you entered is invalid!")
            Exit Sub
        End If

why is it returning false on the line

If ctbTotal.Text < txtCashTendered.Text

when the value of ctbTotal.text is 60.00 and txtCashTendered.text is 100?

Recommended Answers

Take the values and compare not text.

Jump to Post

All 2 Replies

Take the values and compare not text.

okay.. i tried another way around and it works.. thanks btw..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.