• 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

1. 70

2. 82

3. 10

4. 1

5. 2

6. 7

7. 358

8. 5

9. 6

• ### Recently Browsing

×

• Marketplace

• #### Tools

×
• Create New...