Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Created Unassigned: Numeric UpDown doesn't handle percentage formats correctly [22147]

$
0
0
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;
}

```

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>