Which PostgreSQL column type should be used to store a Java BigDecimal?

后端 未结 3 2039
挽巷
挽巷 2021-01-03 20:15

What PostgreSQL column type should I use to store a Java BigDecimal?

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 20:53

    I'd use decimal adding my own scale and precision:

    t.decimal "price", precision: 12, scale: 4, default: "0.0"
    

提交回复
热议问题