Hi all,

i need help with this code.

Sub button_OnClick
  Dim TheForm
  Dim y
  Set TheForm = Document.form1
  If IsNumeric(TheForm.inputbox.Value) Then
    If TheForm.inputbox.Value >= 1 Then
      y = TheForm.inputbox.Value * 1.3
	  Alert("Your $AUD is $" & y)
    End If
    Alert("Please enter a numeric value.")
  End If
End Sub

<form name="form1">
	<input type="text" name="inputbox">
	<input type="button" value="convert" name="button">

How would i get it so when i enter a number and it gets converted, it comes back in $ format? eg if i enter 1, it comes back $1.3 but how would i get it to be $1.30 without just adding 0 on the end?

Thanks Wilko

Look up the FORMAT function.

Be a part of the DaniWeb community

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