Merge master into feature/GraphingCalculator branch (#660)

This commit is contained in:
Pepe Rivera
2019-09-05 15:01:12 -07:00
committed by GitHub
parent 1c9755d38a
commit 41fbcfe9c5
199 changed files with 5809 additions and 2925 deletions

View File

@@ -137,6 +137,7 @@ void COpndCommand::AppendCommand(int command)
{
m_commands->Append(command);
}
if (command == IDC_PNT)
{
m_fDecimal = true;
@@ -256,38 +257,30 @@ const wstring& COpndCommand::GetToken(wchar_t decimalSymbol)
}
// Remove zeros
bool fDigitsFound = false;
int trimIdx = 0;
for (unsigned int i = 0; i < m_token.size(); i++)
{
if (m_token.at(i) != chZero)
{
if (m_token.at(i) == decimalSymbol)
{
trimIdx = i - 1;
m_token.erase(0, i - 1);
}
else
{
trimIdx = i;
m_token.erase(0, i);
}
fDigitsFound = true;
break;
if (m_fNegative)
{
m_token.insert(0, &chNegate);
}
return m_token;
}
}
if (fDigitsFound)
{
m_token.erase(0, trimIdx);
if (m_fNegative)
{
m_token.insert(0, &chNegate);
}
}
else
{
m_token.clear();
m_token.append(&chZero);
}
m_token.clear();
m_token.append(&chZero);
return m_token;
}