Jump to content

Ams De Işlem Önceliği Varmı


WolfmanTR_
 Share

Recommended Posts

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..
Link to comment
Share on other sites

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 by nightmare3519
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...