bigdecimal
Can't get decimals to display in text field for Rails 3
Confused Rails 3 newbie. My model has a purchase_price attribute defined like this: t.decimal :purchase_price, :precision => 12, :scale => 2, :default => 0.00[详细]
2023-03-17 00:51 分类:问答How do I map a BigDecimal in Hibernate so I get back the same scale I put in?
In Java, new BigDecimal(\"1.0\"开发者_JAVA技巧) != new BigDecimal(\"1.00\") i.e., scale matters.[详细]
2023-03-16 11:00 分类:问答Saving a BigDecimal to a decimal field in the database makes BigDecimal different
I always thought you should never use floats for saving m开发者_Go百科oney in the database. So i used decimal. The problem is i save a decimal 100 and it puts it in the database as 99.9999[详细]
2023-03-14 07:21 分类:问答Trim More than two trailing Zeros in BigDecimal
What would be a good way to trim more than two trailing zeros for a BigDecimal So 1.2200 would print 1.22 and 1.0000 would print 1.00[详细]
2023-03-09 12:11 分类:问答How to use BigDecimal with JFormattedTextField
I have a field as: jFormattedTextFieldGrossWeight = new javax.swing.JFormattedTextField(); jFormattedTextFieldGrossWeight.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.sw[详细]
2023-03-07 10:51 分类:问答How does the implementation of ScalaNumber work regarding underlying?
scala.math.ScalaNumber is a Java file which looks like this: public abstract class ScalaNumber extends java.lang.Number {[详细]
2023-03-07 07:04 分类:问答How to get "shortest" BigDecimal that uniquely determines a given double
Basically, I\'m curious on how to get hold of new BigDecimal(Double.toString(d)) without going through the process of creating a string.[详细]
2023-03-07 06:45 分类:问答Different results are obtained while rounding decimals
double radius = 5; double area = Math.PI * Math.pow(radius, 2); // System.out.println(area); BigDe开发者_高级运维cimal bd = new BigDecimal(area).setScale(2, HALF_UP);[详细]
2023-03-07 03:59 分类:问答losing precision converting from java BigDecimal to double
I am working with an application that is based entirely on doubles, and am having trouble in one utility method that parses a string into a double.I\'ve found a fix where using BigDecimal for the conv[详细]
2023-02-28 13:28 分类:问答Efficient BigDecimal round Up and down to two decimals
In java am trying to find an efficient way to round a BigDecimal to two decimals, Up or Down based on a condition.[详细]
2023-02-25 16:55 分类:问答