mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-13 00:32:52 -07:00
Accept exponential numbers without -/+ sign. (#270)
* add exponential without sign support * Add unit tests * fix formatting * remove extra spaces * modify unit tests
This commit is contained in:
parent
9f01c8168b
commit
750130c2bc
4 changed files with 35 additions and 10 deletions
|
@ -881,14 +881,25 @@ void StandardCalculatorViewModel::OnPaste(String ^ pastedString, ViewMode mode)
|
|||
}
|
||||
}
|
||||
|
||||
// Handle exponent and exponent sign (...e+... or ...e-...)
|
||||
// Handle exponent and exponent sign (...e+... or ...e-... or ...e...)
|
||||
if (mappedNumOp == NumbersAndOperatorsEnum::Exp)
|
||||
{
|
||||
++it;
|
||||
if (!(MapCharacterToButtonId(*it, canSendNegate) == NumbersAndOperatorsEnum::Add))
|
||||
//Check the following item
|
||||
switch (MapCharacterToButtonId(*(it + 1), canSendNegate))
|
||||
{
|
||||
case NumbersAndOperatorsEnum::Subtract:
|
||||
{
|
||||
Command cmdNegate = ConvertToOperatorsEnum(NumbersAndOperatorsEnum::Negate);
|
||||
m_standardCalculatorManager.SendCommand(cmdNegate);
|
||||
++it;
|
||||
}
|
||||
break;
|
||||
case NumbersAndOperatorsEnum::Add:
|
||||
{
|
||||
//Nothing to do, skip to the next item
|
||||
++it;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue