Fix a bug : don't double '-' sign on negative numbers
This commit is contained in:
parent
5ea898b837
commit
224267f360
|
@ -43,13 +43,9 @@ namespace uPDFParser
|
|||
std::string Integer::str()
|
||||
{
|
||||
std::string sign("");
|
||||
if (_signed)
|
||||
{
|
||||
if (_value >= 0)
|
||||
// Sign automatically added for negative numbers
|
||||
if (_signed && _value >= 0)
|
||||
sign = "+";
|
||||
else
|
||||
sign = "-";
|
||||
}
|
||||
|
||||
return " " + sign + std::to_string(_value);
|
||||
}
|
||||
|
@ -57,13 +53,8 @@ namespace uPDFParser
|
|||
std::string Real::str()
|
||||
{
|
||||
std::string sign("");
|
||||
if (_signed)
|
||||
{
|
||||
if (_value >= 0)
|
||||
if (_signed && _value >= 0)
|
||||
sign = "+";
|
||||
else
|
||||
sign = "-";
|
||||
}
|
||||
|
||||
return " " + sign + std::to_string(_value);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user