Hello I need help getting this to display the 3 outputs (Euro, Franc, Rand) with 2 decimal places (1.00)
I have all the calculations done so this is what I have as my code:

Public Class frmConvert

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click


    End Sub

    Private Sub btnConvert_Click(sender As Object, e As EventArgs) Handles btnConvert.Click

        txtEur.Text = txtDollar.Text * 0.89
        txtFranc.Text = txtDollar.Text * 0.95
        txtRand.Text = txtDollar.Text * 11.54

    End Sub
End Class
2 Years
Discussion Span
Last Post by Minimalist

Hi, Cameron 2, welcome. :)
Use Format:
' Returns "5,459.40".
TestStr = Format(5459.4, "##,##0.00")
Taken from the example at the end of this webpage

Votes + Comments
Useful Resource

You are aware that you let the compiler do your conversions from text to decimal. Put option strict on and you will get some errors.Why? because you are multiplying text as in:

 txtEur.Text = txtDollar.Text * 0.89

It is much better to declare variables correctly like:
Dim DecDollar as Decimal =0 etc.

Votes + Comments
So true!
This topic has been dead for over six months. 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.