Jump to content
Forgot your email address? ×
×
×
  • Create New...
  • 0

Yang value separated by "." in trade


DaNy3LL

Question

Hello guys, does anyone know how to make the yang in trade to be separated by "." ? I guess from uiexchange.py or uicommon.py , but I don't know exactly what I need to edit.

 

For example I have

 

591067b87736ef24b2128aaea663170c.png

 

And I want that 1111111 to be shown as 1.111.111

 

Kind Regards, DaNy3LL

Link to comment

4 answers to this question

Recommended Posts

  • 0

Open localeinfo.py and find this:

	def NumberToMoneyString(n) :
		if n <= 0 :
			return "0 %s" % (MONETARY_UNIT0)

		return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT0)

and replace it to this:

	def NumberToMoneyString(n,y=0) :
		if n <= 0 :
			if y == 0:
				return "0 %s" % (MONETARY_UNIT0)
			else:
				return "0"
		if y == 0:
			return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT0) 
		else:
			return "%s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ])) 
self.OwnerMoney.SetText(localeInfo.NumberToMoneyString(exchange.GetElkFromSelf(),1))
self.TargetMoney.SetText(localeInfo.NumberToMoneyString(exchange.GetElkFromTarget(),1))
  • Love 4
Link to comment
  • 0

Open uiexchange.py from root, and find this:

self.OwnerMoney.SetText(str(exchange.GetElkFromSelf()))
self.TargetMoney.SetText(str(exchange.GetElkFromTarget()))

Replace to this:

self.OwnerMoney.SetText(str(('.'.join([ i-3<0 and str(exchange.GetElkFromSelf())[:i] or str(exchange.GetElkFromSelf())[i-3:i] for i in range(len(str(exchange.GetElkFromSelf()))%3, len(str(exchange.GetElkFromSelf()))+1, 3) if i ]))))
self.TargetMoney.SetText(str(('.'.join([ i-3<0 and str(exchange.GetElkFromTarget())[:i] or str(exchange.GetElkFromTarget())[i-3:i] for i in range(len(str(exchange.GetElkFromTarget()))%3, len(str(exchange.GetElkFromTarget()))+1, 3) if i ]))))
  • Love 3
Link to comment
  • 0

 

Open uiexchange.py from root, and find this:

self.OwnerMoney.SetText(str(exchange.GetElkFromSelf()))
self.TargetMoney.SetText(str(exchange.GetElkFromTarget()))

Replace to this:

self.OwnerMoney.SetText(str(('.'.join([ i-3<0 and str(exchange.GetElkFromSelf())[:i] or str(exchange.GetElkFromSelf())[i-3:i] for i in range(len(str(exchange.GetElkFromSelf()))%3, len(str(exchange.GetElkFromSelf()))+1, 3) if i ]))))
self.TargetMoney.SetText(str(('.'.join([ i-3<0 and str(exchange.GetElkFromTarget())[:i] or str(exchange.GetElkFromTarget())[i-3:i] for i in range(len(str(exchange.GetElkFromTarget()))%3, len(str(exchange.GetElkFromTarget()))+1, 3) if i ]))))

 

Just use localeInfo.NumberToMoneyString(money) instead of this big ugly string you posted.

 

  • Love 2
Link to comment
  • 0

I tried something like this

		self.OwnerMoney.SetText(localeInfo.NumberToMoneyString(exchange.GetElkFromSelf()))
		self.TargetMoney.SetText(localeInfo.NumberToMoneyString(exchange.GetElkFromTarget()))

It works , but is there any way to only show the value and not "Yang" ? The value is kinda misplaced...

 

c094c8babd263301200b2243f79450bd.png

 

Shang's strings work well , but localeInfo.NumberToMoneyString it's much shorter

self.OwnerMoney.SetText(str(('.'.join([ i-3<0 and str(exchange.GetElkFromSelf())[:i] or str(exchange.GetElkFromSelf())[i-3:i] for i in range(len(str(exchange.GetElkFromSelf()))%3, len(str(exchange.GetElkFromSelf()))+1, 3) if i ]))))
self.TargetMoney.SetText(str(('.'.join([ i-3<0 and str(exchange.GetElkFromTarget())[:i] or str(exchange.GetElkFromTarget())[i-3:i] for i in range(len(str(exchange.GetElkFromTarget()))%3, len(str(exchange.GetElkFromTarget()))+1, 3) if i ]))))

a7fad39535249a57a3d158f5a380b8b1.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.