- Katılım
- 17 Eki 2016
- Konular
- 129
- Mesajlar
- 2,424
- Çözüm
- 86
- Online süresi
- 2mo 11d
- Reaksiyon Skoru
- 1,299
- Altın Konu
- 1
- Başarım Puanı
- 258
- MmoLira
- 1,173
- DevLira
- 12
ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!
I’d gladly close my topic if you’re willing to release a bug free one, I’ve seen a similar topic in m2dev since Turkish player base is more likely to use M and T prefixes this was the change I made back in 2-3 months agoThe idea is good, but the code is bugged and unreadable, here're the bugs:
text = '1kks'
text = '1kk500'
- ValueError: invalid literal for int() with base 10: '1000000s'
text = '1abcd'
- 1000000500
- '1abcd'
If I'm the one who do this, i would do it more extendable and using a proficient way.
![]()
![]()
![]()
![]()
Python:import re def __ConvertMoneyText(self, text, powers=dict(k=10**3, m=10**6, b=10**9)): """ Format string value in thousands, millions or billions. '1k' = 1.000 '100kk' = 100.000.000 '100m' = 100.000.000 '1b' = 1.000.000.000 '1kmb' = 1.000 (can't use multiple suffixes types) :param text: string :return: int :date: 10.01.2020 :author: Vegas """ match = re.search(r'(\d+)({:s}+)?'.format('+|'.join(powers.keys())), text, re.I) if match: moneyValue, suffixName = match.groups() moneyValue = int(moneyValue) if not suffixName: return moneyValue return moneyValue * (powers[suffixName[0]] ** len(suffixName)) return 0 def OnAccept(self): text = self.pickValueEditLine.GetText() if text: moneyValue = min(self.__ConvertMoneyText(text), self.maxValue) if moneyValue: if self.eventAccept: self.eventAccept(moneyValue) self.Close()
- Katılım
- 17 Tem 2018
- Konular
- 533
- Mesajlar
- 3,963
- Çözüm
- 34
- Online süresi
- 11mo 8d
- Reaksiyon Skoru
- 1,769
- Altın Konu
- 50
- TM Yaşı
- 7 Yıl 11 Ay 1 Gün
- Başarım Puanı
- 327
- MmoLira
- 9,326
- DevLira
- 45
Paylaşım için teşekkürler.
- Katılım
- 3 Ara 2017
- Konular
- 2,167
- Mesajlar
- 12,007
- Çözüm
- 87
- Online süresi
- 1y 2mo
- Reaksiyon Skoru
- 18,324
- Altın Konu
- 91
- TM Yaşı
- 8 Yıl 6 Ay 13 Gün
- Başarım Puanı
- 506
- Yaş
- 28
- MmoLira
- 119,845
- DevLira
- 176
Paylaşımın için saol 

- Katılım
- 17 Eki 2016
- Konular
- 129
- Mesajlar
- 2,424
- Çözüm
- 86
- Online süresi
- 2mo 11d
- Reaksiyon Skoru
- 1,299
- Altın Konu
- 1
- Başarım Puanı
- 258
- MmoLira
- 1,173
- DevLira
- 12
I’d gladly close my topic if you’re willing to release a bug free one, I’ve seen a similar topic in m2dev since Turkish player base is more likely to use M and T prefixes this was the change I made back in 2-3 months ago
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
Konu orjinal kodları buyrun. K lar T yapılmış sadece.
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 2
- Görüntüleme
- 302
- Cevaplar
- 13
- Görüntüleme
- 1K
- Cevaplar
- 16
- Görüntüleme
- 2K
- Cevaplar
- 8
- Görüntüleme
- 692
- Cevaplar
- 2
- Görüntüleme
- 270










