Package com.opengamma.web.server.conversion

Examples of com.opengamma.web.server.conversion.DoubleValueFormatter


    if (targetType == ComputationTargetType.POSITION) {
      Position position = row.getPosition();
      details.put("posId", position.getUniqueId());
      details.put("position", position.getSecurity().getName());
      DoubleValueFormatter formatter = new DoubleValueOptionalDecimalPlaceFormatter();
      details.put("quantity", position.getQuantity().signum() == 0 ? "0" : formatter.format(position.getQuantity()));
    } else {
      details.put("position", row.getAggregateName());
    }
  }
View Full Code Here


  private static DoubleValueFormatter getFormatter(ValueSpecification valueSpec) {
    if (valueSpec == null) {
      return s_defaultFormatter;
    }
    DoubleValueFormatter valueNameFormatter = s_formatters.get(valueSpec.getValueName());
    if (valueNameFormatter != null) {
      return valueNameFormatter;
    } else {
      if (valueSpec.getProperties().getValues(ValuePropertyNames.CURRENCY) != null) {
        return s_defaultCcyFormatter;
View Full Code Here

    return DataType.DOUBLE;
  }

  @Override
  public String formatCell(BigDecimal value, ValueSpecification valueSpec, Object inlineKey) {
    DoubleValueFormatter formatter = getFormatter(valueSpec);
    String formattedNumber = formatter.format(value);
    return formatter.isCurrencyAmount() && _currencyDisplay == DISPLAY_CURRENCY ?
        formatWithCurrency(formattedNumber, valueSpec) :
        formattedNumber;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.web.server.conversion.DoubleValueFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.