m = CStr(InputBox("ukucajte masu u kilogramima"))
h = CStr(InputBox("ukucajte visinu u centimetrima"))
Podesi m: Podesi h: m = CSng(m): h = CSng(h)
MsgBox "BMI (indeks tjelesne mase) je:" _
& vbCrLf & Round(((m * 1.3) / ((h / 100) ^ 2.5)), 1)
Public Sub Podesi(ByRef e)
If Mid(CStr(3 / 2), 2, 1) = "." Then
ee = CLng(InStr(1, e, ",", 1))
If ee > 0 Then e = CStr(Left(e, ee - 1) & "." & Right(e, Len(e) - ee))
else
ee = CLng(InStr(1, e, ".", 1))
If ee > 0 Then e = CStr(Left(e, ee - 1) & "," & Right(e, Len(e) - ee))
End If
End Sub
Public Sub Podesi(ByRef e)
If Mid(CStr(3 / 2), 2, 1) = "." Then
ee = CLng(InStr(1, e, ",", 1))
If ee > 0 Then e = CStr(Left(e, ee - 1) & "." & Right(e, Len(e) - ee))
else
ee = CLng(InStr(1, e, ".", 1))
If ee > 0 Then e = CStr(Left(e, ee - 1) & "," & Right(e, Len(e) - ee))
End If
End Sub