Currently if you set a numerical updown to have a format string with a 'P' as the first character the numerical updown will have issues when parsing direct input.
This is caused by CommonNumericUpDown::ContainsLetterForPercent() which gets the index of 'P' then does a greater than 0 check rather than a greater or equal to 0 check.
```
private bool ContainsLetterForPercent( string stringToTest )
{
int PIndex = stringToTest.IndexOf( "P" );
if( PIndex > 0 ) // This should be >=
{
//stringToTest contains a "P" between 2 "'", it's not considered as percent
return !( stringToTest.Substring( 0, PIndex ).Contains( "'" )
&& stringToTest.Substring( PIndex, FormatString.Length - PIndex ).Contains( "'" ) );
}
return false;
}
```
This is caused by CommonNumericUpDown::ContainsLetterForPercent() which gets the index of 'P' then does a greater than 0 check rather than a greater or equal to 0 check.
```
private bool ContainsLetterForPercent( string stringToTest )
{
int PIndex = stringToTest.IndexOf( "P" );
if( PIndex > 0 ) // This should be >=
{
//stringToTest contains a "P" between 2 "'", it's not considered as percent
return !( stringToTest.Substring( 0, PIndex ).Contains( "'" )
&& stringToTest.Substring( PIndex, FormatString.Length - PIndex ).Contains( "'" ) );
}
return false;
}
```