![]() |
Noktadan sonraki sayı |
Post Reply ![]() |
|
Author | |
GESTHAUZE ![]() Newbie ![]() Joined: 06 Ekim 2005 Location: Türkiye Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() Posted: 31 Temmuz 2018 at 00:56 |
Selamlar. Örnek olarak 10.26 sayısının noktadan sonraki basamaklarını almak için derleyici içerisinde hazır bir fonksiyon varmıdır ? Ya da nasıl alabiliriz ? Yuvarlama yapmak istemiyorum. Olduğu gibi noktadan sonrasını almak istiyorum. Math fonksiyonunu araştırdım ama böyle bir özelliği yok herhalde ?
|
|
![]() |
|
GESTHAUZE ![]() Newbie ![]() Joined: 06 Ekim 2005 Location: Türkiye Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
Şöyle bir yöntem ile işimi halettim
double sayi = 10.22; string ara; ara = sayi.ToString(); int dere = ara.IndexOf(',')+1; textBox1.Text = ara.Substring(dere,2); MessageBox.Show("" + dere); double değişkenine biz nokta koymuş olsak da stringe ","(virgül) olarak aktarıyor.Nokta aramaya kalkınca -1 döndürüyor. |
|
![]() |
|
07excellency07 ![]() Newbie ![]() Joined: 05 Ekim 2011 Location: Turkey Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
Sayıda sabit nokta varsa çok kolay.
string ondalıklar=sayi.ToString().Split('.')[1].ToString(); şeklinde alabilirsin. Basamaktan sonra rakam olursa olsun alır.
|
|
Kodlama Sanatının kalfalarından biriyim....
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |