- Katılım
- 2 Eyl 2017
- Konular
- 2,051
- Mesajlar
- 7,142
- Çözüm
- 236
- Online süresi
- 6mo 29d
- Reaksiyon Skoru
- 4,086
- Altın Konu
- 74
- TM Yaşı
- 8 Yıl 9 Ay 14 Gün
- Başarım Puanı
- 392
- Yaş
- 37
- MmoLira
- 334
- DevLira
- 0
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!
Sizi anliyorum yanlız bölüm kurallari gereğince çalıştığına dair görsel eklenmesi gerekfinal haftamdayım serverıda uzun zamandır açmıyorum basit şeyler paylaştım zaten![]()
- Katılım
- 13 Haz 2013
- Konular
- 182
- Mesajlar
- 2,499
- Çözüm
- 92
- Online süresi
- 3mo 20d
- Reaksiyon Skoru
- 1,662
- Altın Konu
- 2
- TM Yaşı
- 13 Yıl 1 Gün
- Başarım Puanı
- 289
- Yaş
- 28
- MmoLira
- 8,600
- DevLira
- 84
Teşekkürler
- Katılım
- 6 Eyl 2016
- Konular
- 34
- Mesajlar
- 73
- Online süresi
- 3d 2h
- Reaksiyon Skoru
- 168
- Altın Konu
- 0
- TM Yaşı
- 9 Yıl 9 Ay 10 Gün
- Başarım Puanı
- 97
- Yaş
- 36
- MmoLira
- 1,337
- DevLira
- 12
Python:
USE_MONEY_T_FORMAT = True
if USE_MONEY_T_FORMAT:
def FormatMoneyToK(string):
moneyString = str(string)
money = 0
if len(moneyString) > 1:
if 't' in moneyString:
money = int(moneyString.replace('t', '000000'))
elif 'T' in moneyString:
money = int(moneyString.replace('T', '000000'))
return money
The idea is good, but the code is bugged and unreadable, here're the bugs:
text = '1kks'
- ValueError: invalid literal for int() with base 10: '1000000s'
- 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
- 13 Haz 2013
- Konular
- 182
- Mesajlar
- 2,499
- Çözüm
- 92
- Online süresi
- 3mo 20d
- Reaksiyon Skoru
- 1,662
- Altın Konu
- 2
- TM Yaşı
- 13 Yıl 1 Gün
- Başarım Puanı
- 289
- Yaş
- 28
- MmoLira
- 8,600
- DevLira
- 84
Thank you for update and ideaThe 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
- 21 Mar 2011
- Konular
- 205
- Mesajlar
- 2,122
- Çözüm
- 23
- Online süresi
- 3mo 1d
- Reaksiyon Skoru
- 292
- Altın Konu
- 0
- TM Yaşı
- 15 Yıl 2 Ay 26 Gün
- Başarım Puanı
- 214
- MmoLira
- 9,628
- DevLira
- 3
Teşekkürler. Yabancıların kullandığı sistem daha iyi bence. her k harfi 3 tane 0 ediyor biliyorsunuzdur.
1k = 1k
1kk = 1m
1kkk = 1t
1k = 1k

1kk = 1m
1kkk = 1t
Ş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





