In my application (WCF, REST, .NET) in an object request I get a value of type double. I need this method to properly fulfilled on numbers with the decimal part "," and ".". How to arrange it without resorting to the type of string. For example: values "3,25" or "3.25" should be treated the same as the type of double.
例如:
这是申请标本中使用的类别。
[DataContract]
public class TripRatesMapped
{
[DataMember(IsRequired = true)]
public double Tolls { get; set; }
[DataMember(IsRequired = true)]
public double Parking { get; set; }
[DataMember(IsRequired = true)]
public double ExtraGr { get; set; }
[DataMember(IsRequired = true)]
public double Misc1 { get; set; }
[DataMember(IsRequired = true)]
public double Misc2 { get; set; }
}
这是申请对象的一部分。
{ "ExtraGr":1.25 , "Misc1":1.26 , "Misc2":1.27, "Parking":1.28, "Tolls":1.29 }
因此,我可以提出这样的请求:
{ "ExtraGr":1,25, "Misc1":1,26, "Misc2":1,27, "Parking":1,28, "Tolls":1,29 }
如果不使用打字法,这是否可行?