taskaleli Posted August 16, 2016 Share Posted August 16, 2016 Arkadaşlar küçük bir sorunum var. matematiksel bir işlem sonucunda sayı tam sayı ise sonuna .00 yada 1.9 gibi bir sayı ise 1.90 olarak yazdırmak istiyorum bunu nasıl yapabilirim. kolay bir yolu varmıdır. excel'deki ondalık ayracı gibi eğer tam sayı bile olsa sonda .00 görünsün istiyorum. değerli yardımlarınız için şimdiden teşekkür ederim. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted August 16, 2016 Share Posted August 16, 2016 sanırım AMS kodları içinde format yok ama lua ile yapabilirsiniz: sayi = 1.9 Dialog.Message("", string.format("%.2f", sayi)); Quote Link to comment Share on other sites More sharing options...
taskaleli Posted August 16, 2016 Author Share Posted August 16, 2016 16 dakika önce, KintaRo yazdı: sanırım AMS kodları içinde format yok ama lua ile yapabilirsiniz: sayi = 1.9 Dialog.Message("", string.format("%.2f", sayi)); Çok teşekkür ederim üstad. İşimi gördü. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted September 17, 2016 Editor Share Posted September 17, 2016 Değer olarak tutmak istersenizde bunu kullanabilirsiniz Kintaronunkine ek olarak. function tamsayimi(n) return n==math.floor(n) end if tamsayimi(1.9) then --değil else --tamsayi end 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.