You can create a custom type that extends the decimal number and specify the number of digits in fractionDigits
as follows:
<xs:simpleType name="twoPlacesDecimal" id="twoPlacesDecimal"> <xs:restriction base="xs:decimal"> <xs:fractionDigits fixed="true" value="2" /> </xs:restriction> </xs:simpleType>
You can specify the data type for a property using XmlAttribute(DataType = "value")
, but unfortunately this only supports built-in data types. From my reading of the source, if you include a custom data type, you will get an exception.
source share