WolfmanTR_ Posted August 28, 2012 Share Posted August 28, 2012 arkadaşlar, vicıt kitle indeksini hesaplamak için küçük birşey yazayım dedim.onda bazı sıkıntılar çıktı.ben 2 tane inputa yazıyorum boy ve kiloyu önce bölme işlemi sonrada çaprma işlemi yapmasını istiyorum ama işlemi yapmıyor, örn in 1 ve 2 ye yazıyorum 1.70 - 50 diye , sonuç olarak 50 yazıyor , halbuki 1.70x1.70 = 2.79 50/2.79 = 17.9211... çıkması gerekiyor kod = [CODE] boy = Input.GetText("Input2"); if boy ~= "0" then end kilo = Input.GetText("Input1"); if kilo ~= "0" then end Label.SetText("Label3", "Vücut Kitle Endeksiniz (BMI): "..kilo/boy*boy.." kg/m2");[/CODE] birde yuvarlama işlemini yapamadım , örn sonuç 17.92112849846 gibi sonuç çıkıyor ben sadece 17.92 yazdırmak isziyorum birde çıkan sonuca göre örn: sonuç 23 ise, kilonuz normal - 30 ise aşırı kilolusunuz dr. a görnn gibi.. Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted August 29, 2012 Share Posted August 29, 2012 (edited) O zaman sende şöyle yap: [color=#000000]Vücut kitle endeksi hesabı yanlış [img]http://www.tnctr.com//public/style_emoticons/default/biggrin.png[/img] Doğrusu böyle olacak[/color] boy = Input.GetText("Input2"); if boy ~= "0" then end kilo = Input.GetText("Input1"); if kilo ~= "0" then end Label.SetText("Label1", "Vücut Kitle Endeksiniz (BMI): "..Math.Floor(kilo/(boy*boy)).." kg/m2"); Bu math floor tam olarak gösterşyor mesela 22.442452 ise direk 22 yazdırıyor hadi kolay gelsin Edited August 29, 2012 by nightmare3519 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.