Java – what XML data types should be used for money / money?

After reading a few questions about Java data types for money / currency, I decided to use the int / long method to store the value of money / currency as its lowest unit (such as cents)

Does this apply to storing data (in XML)?

The first thing I think of is no, because it will be "parsed" into an XML decimal format when storing data, and "parsed" again when I read the data

Any suggestion is welcome because I am new

Solution

I use this

<xsd:simpleType name="money">
      <xsd:restriction base="xsd:decimal">
         <xsd:fractionDigits value="2"/>
      </xsd:restriction>
</xsd:simpleType>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>