Dim nb As Double
If EditText1.Text <> "" Then
nb = EditText1.Text ' converts the String into a Double
' nb = Floor(nb * 100 + 0.5) / 100 ' rounds to two decimals
nb = Round2(nb, 2) ' rounds to two decimals
nb = Max(0.01, nb) ' sets min value to 0.01
nb = Min(3.00, nb) ' sets max value to 3.00
EditText1.Text = NumberFormat2(nb, 1, 2, 2, False) ' displays with two decimals
End If