List of usage examples for java.text ChoiceFormat ChoiceFormat
public ChoiceFormat(String newPattern)
From source file:ch.algotrader.entity.security.SecurityFamilyImpl.java
@Override public double getTickSize(String broker, double price, boolean upwards) { // add or subtract a very small amount to the price to get the tickSize just above or below the trigger double adjustedPrice = upwards ? price * 1.00000000001 : price / 1.00000000001; return Double.valueOf(new ChoiceFormat(getTickSizePattern(broker)).format(adjustedPrice)); }
From source file:org.apache.hive.beeline.BeeLine.java
String loc(String res, int param) { try {/* www . j a v a2 s .c o m*/ return MessageFormat.format(new ChoiceFormat(resourceBundle.getString(res)).format(param), new Object[] { new Integer(param) }); } catch (Exception e) { return res + ": " + param; } }