Cleaned up another use of snprintf
This removes the leading space before the first digit, but I think it looks better.
This commit is contained in:
parent
fbfabfba50
commit
88d0619d58
1 changed files with 1 additions and 3 deletions
|
@ -584,9 +584,7 @@ std::string unit_topic_generator::operator()() const {
|
|||
try {
|
||||
resistance -= std::stoi(dam_it.second);
|
||||
} catch(std::invalid_argument) {}
|
||||
char resi[16];
|
||||
snprintf(resi,sizeof(resi),"% 4d%%",resistance); // range: -100% .. +70%
|
||||
std::string resist = resi;
|
||||
std::string resist = std::to_string(resistance) + '%';
|
||||
const size_t pos = resist.find('-');
|
||||
if (pos != std::string::npos) {
|
||||
resist.replace(pos, 1, utils::unicode_minus);
|
||||
|
|
Loading…
Add table
Reference in a new issue