I am writing a library in Java so I can use it in JRuby on Rails with a MySQL database. Should I use float or double to represent the floating point that is eventually going to end up as the :decimal model type in Rails ActiveRecord?
More explicitly:
-
double converts to a DOUBLE PRECISION
-
float converts to a FLOAT
But since only :decimal is supported in ActiveRecord, which Java primitive maps to that?
The equivalent in Java is the BigDecimal class. There is no primitive for this.