Actual Cost - wrong number format

Hi,

when I try to re-open a xml file generated by Aspose.Tasks, I get the following error:

Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Xml.XmlConvert.ToInt32(String s)
at .(String )
at .(XmlElement , Object )
at .(XmlNodeList ,  , Type )
at .(Stream )
at Aspose.Tasks.ProjectReader.Read(Stream stream)

I found that the entries responsable for this are the ActualCost elements, that contain double values (which is as it is specified in the API). As it seems, ProjectReader tries to read those values as Int32...

thanks for having a look at this and best regards,

philippe der hovsepian

Hello Philippe,

I think there is problem with ProjectWriter because ResourceAssignment.ActualCost should be Int32 value in xml. Could you please provide the project file for additional testing?

Hello Alexej

here is a file that was produced by Aspose.Tasks (version 2.1.2).

Please have a look at the API too. It states the following number types for ActualCost:

  • ResourceAssignment.ActualCost: decimal
  • Resource.ActualCost: decimal
  • Task.ActualCost: double

I'm not sure, but I think this should be consistent. And I think, double or decimal are definitely better suiting than int values, since we're talking about money amounts here.

thanks and regards,

philippe

Hello Philippe,

The ActualCost problem has been fixed. We checked also other Cost properties and they look correct. Please download updated Aspose.Tasks version here.