Skip to content

Instantly share code, notes, and snippets.

@felixlindemann
Created December 18, 2014 09:40
Show Gist options
  • Save felixlindemann/29280e41ea7ef5167e66 to your computer and use it in GitHub Desktop.
Save felixlindemann/29280e41ea7ef5167e66 to your computer and use it in GitHub Desktop.
Lime-tree Test 01: Default.aspx.vb
Private Sub calc()
Dim _return As String = ""
Try
Dim dbl As Double = CDbl(sugarlevel.Text)
Select Case cbolevel.SelectedValue
Case 2
dbl *= 18.02
_return = String.Format("{0} [mg/dl]", Format(dbl, "0.00"))
Case 1
dbl /= 18.02
_return = String.Format("{0} [mmol/l]", Format(dbl, "0.00"))
End Select
Catch ex As Exception
_return = "Bitte nur numerische Werte eingeben"
End Try
txtresult.Text = _return
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment