Kaeptn 24 Posted April 24, 2018 i have an issue with this macro: {{py: xvm.total_hp.mainGun ('', {{hitlog.dmg-total}})% 'i}} if you achieve high caliber value, it will display a negative value: do not know if this is some sort of bug, but i would like to show some text instead of it. any ideas? Quote Share this post Link to post Short link Share on other sites
ktulho 5,790 #428482 Posted April 24, 2018 (edited) Может быть так: {{py:xvm.total_hp.mainGun('', {{hitlog.dmg-total}})%'d}} Edited April 24, 2018 by ktulho Quote Share this post Link to post Short link Share on other sites
Kaeptn 24 #428524 Posted April 25, 2018 no change, bothe integer. Quote Share this post Link to post Short link Share on other sites
ktulho 5,790 #428525 Posted April 25, 2018 @Kaeptn attach replay. Quote Share this post Link to post Short link Share on other sites
Kaeptn 24 #428526 Posted April 25, 2018 (edited) http://wotreplays.eu/site/4320838?secret=a0a200cab87bdc82b11a547d334cfa04 complete macro: "efficiency": { "enabled": true, "updateEvent": "PY(ON_BATTLE_EFFICIENCY), PY(ON_UPDATE_HP)", "x": 540, "y": 54, "width": 247, "height": 60, "screenHAlign": "center", "visibleOnHotKey": true, "shadow": { "enabled": true, "distance": 0, "angle": 0, "color": "0x000000", "alpha": 50, "blur": 9, "strength": 2 }, "textFormat": { "font": "$FieldFont", "size": 13, "color": "0xF0F0F0", "valign": "center" }, "format": "<textformat leading='2' tabstops='[70, 95]'>{{battletype?|Großkaliber<tab><img src='cfg://pe3pa/res/mainGun.png' vspace='-3'><tab><font face='$TitleFont'>{{py:xvm.total_hp.mainGun(' ',{{hitlog.dmg-total}})%'s}}</font><br>Ø Schaden<tab><img src='cfg://pe3pa/res/average.png' vspace='-2'><tab><font face='$TitleFont' color='{{py:efficiencyDIFFAvgDmgColor({{tdb}})}}'>{{py:efficiencyDIFFAvgDmg({{tdb}})%'i|0}}</font><br>Erwartet<tab><img src='cfg://pe3pa/res/expected.png' vspace='-2'><tab><font face='$TitleFont' color='{{py:efficiencyDIFFExpDmgColor}}'>{{py:efficiencyDIFFExpDmg%'i}}</font>}}</textformat>" }, Edited April 25, 2018 by Kaeptn Quote Share this post Link to post Short link Share on other sites
ktulho 5,790 #428531 Posted April 25, 2018 @Kaeptn дело в том что, макрос {{py:xvm.total_hp.mainGun(' ',{{hitlog.dmg-total}})}} возвращает строку, а вы пытаетесь его форматировать, как целое число: Цитата " ' " for thousands separator (only for integer numbers) Quote Share this post Link to post Short link Share on other sites
Kaeptn 24 #428553 Posted April 25, 2018 thousand seperator is needed to match the rest of the default UI. is there a way arround this? Quote Share this post Link to post Short link Share on other sites
ktulho 5,790 #428554 Posted April 25, 2018 Это можно сделать, только создав новый py_macro. Quote Share this post Link to post Short link Share on other sites
Kaeptn 24 #428555 Posted April 25, 2018 thank you! Quote Share this post Link to post Short link Share on other sites