jCalc/Calculator.xaml.cs
/// <summary>
/// Negate the current displayEntry if possible
/// </summary>
Negate the current displayEntry if possible
Negate the current displayEntry if possible
public void NegateEntry()
        {
            if (pendingOperationLocked && !IsEntryClear())
            { 
                if (displayEntry[0] == '-')
                {
                    displayEntry = displayEntry.Substring(1);
                }
                else
                {
                    displayEntry = "-" + displayEntry;
                }
            }
        }
public void NegateEntry ( ) { if ( pendingOperationLocked && ! IsEntryClear ( ) ) { if ( displayEntry [ 0 ] == ' ' ) { displayEntry = displayEntry . Substring ( 1 ) ; } else { displayEntry = " " + displayEntry ; } } }
Negate the current displayEntry if possible
Negate the current displayEntry if possible
// Allow +/- change only if  // pending operation is locked AND a value other than 0 is in the entry // If displayEntry is negative,  // remove negative sign to make positive // Else displayEntry is positive, // add negative sign to make negative