Example usage for java.text ChoiceFormat ChoiceFormat

List of usage examples for java.text ChoiceFormat ChoiceFormat

Introduction

In this page you can find the example usage for java.text ChoiceFormat ChoiceFormat.

Prototype

public ChoiceFormat(String newPattern) 

Source Link

Document

Constructs with limits and corresponding formats based on the pattern.

Usage

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;
    }
}