Method : [StringToNumber] Input string was not in a correct format.

Stimulsoft Reports.NET discussion
Post Reply
magic1362
Posts: 7
Joined: Sun Nov 16, 2008 3:49 pm

Method : [StringToNumber] Input string was not in a correct format.

Post by magic1362 »

What means this error?

Method : [StringToNumber]
Input string was not in a correct format.

Expression for text that has error is:
{SumD(System.Math.Round(double.Parse (Table.QUANTITY))).ToString ()}

Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Method : [StringToNumber] Input string was not in a correct format.

Post by Edward »

Hi

Please check the string which you passed in to the double.Parse() method. It could contain not printed symbols or different from your system locale signs for double values e.g. dot instead of comma or vice versa.

Thank you.
magic1362
Posts: 7
Joined: Sun Nov 16, 2008 3:49 pm

Method : [StringToNumber] Input string was not in a correct format.

Post by magic1362 »

double.Parse() method works fine, but when i use Sum () or Sumd () method this error occur.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Method : [StringToNumber] Input string was not in a correct format.

Post by Edward »

Hi,

We do not have any method named "StringToNumber", but this method exists in a double.Parse method. And in that method error occurs:

internal static unsafe double ParseDouble(string value, NumberStyles options, NumberFormatInfo numfmt)
{
byte* stackBuffer = stackalloc byte[1 * 0x72];
NumberBuffer number = new NumberBuffer(stackBuffer);
double num = 0.0;
StringToNumber(value, options, ref number, numfmt, false);
if (!NumberBufferToDouble(number.PackForNative(), ref num))
{
throw new OverflowException(Environment.GetResourceString("Overflow_Double"));
}
return num;
}

Thank you.
Post Reply