Best practice to represent Money (value + currency) in Grails

后端 未结 5 1283
逝去的感伤
逝去的感伤 2021-02-14 17:01

I\'m not much familiar to Java Currency type, and how it being used in Grails. Though, I\'m yet to use it, I saw a tag to use in the views.

5条回答
  •  一生所求
    2021-02-14 17:08

    You should use BigDecimal. Groovy and Grails has excellent native support for it as a datatype on GORM domain classes as well. For reasoning behind using it, see here

    What is the best data type to use for money in java app?

提交回复
热议问题