NumberFormatInfo nfi = null;
if (provider != null) {
Type typeNFI = typeof (NumberFormatInfo);
- nfi = (NumberFormatInfo) provider.GetFormat (typeNFI);
+ nfi = provider.GetFormat (typeNFI) as NumberFormatInfo;
}
if (nfi == null)
nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
// Number stuff
// Just the same as Int32, but this one adds instead of substract
- do {
+ while (pos < s.Length) {
if (!Int32.ValidDigit (s [pos], AllowHexSpecifier)) {
if (AllowThousands &&
exc = new OverflowException (Locale.GetText ("Value too large or too small."));
return false;
}
- } while (pos < s.Length);
+ }
// Post number stuff
if (nDigits == 0) {