×
×
• Create New...
• 0

# Yang value separated by "." in trade

## 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 And I want that 1111111 to be shown as 1.111.111

Kind Regards, DaNy3LL

## 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))
```
• 4
• 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 ]))))
```
• 3
• 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.

• 2
• 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... 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 ]))))
``` ## Create an account

Register a new account

### Announcements

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

1. 25

2. 25

3. 1

4. 25

5. 1

6. 25

7. 25

8. 25