Examples of format()


Examples of com.microsoft.windowsazure.core.ISO8601DateConverter.format()

        ISO8601DateConverter converter = new ISO8601DateConverter();
        String value = "2012-01-12T00:35:58Z";

        // Act
        Date result = converter.parse(value);
        String value2 = converter.format(result);

        // Assert
        assertNotNull(result);

        Calendar calendar = Calendar.getInstance();
View Full Code Here

Examples of com.ocpsoft.pretty.time.PrettyTime.format()

      TemplateDirectiveBody body) throws TemplateException, IOException {
    TemplateDateModel dateModel =  (TemplateDateModel) params.get("date");
    Date date = dateModel!=null ? dateModel.getAsDate() : null;
    Assert.notNull(date, "Parameter date can not be null!");
    PrettyTime prettyTime = new PrettyTime(env.getLocale());
    env.getOut().write(prettyTime.format(date));
  }

}
View Full Code Here

Examples of com.opengamma.web.server.conversion.DoubleValueFormatter.format()

    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

Examples of com.opengamma.web.server.conversion.DoubleValueOptionalDecimalPlaceFormatter.format()

    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

Examples of com.pholser.junit.quickcheck.generator.InRange.format()

    @Override protected Map<Class<? extends Annotation>, Annotation> configurations() {
        InRange range = mock(InRange.class);
        when(range.min()).thenReturn("1/1/500");
        when(range.max()).thenReturn("12/31/2020");
        when(range.format()).thenReturn("MM/dd/yyyy");
        return Collections.<Class<? extends Annotation>, Annotation> singletonMap(InRange.class, range);
    }

    @Override public void verifyInteractionWithRandomness() {
        verifyLongs(randomForParameterGenerator, times(3), min.getTime(), max.getTime());
View Full Code Here

Examples of com.plainsource.commons.text.CurrencyDecimal.format()

    private void addGrandTotalTokens() {
        BigDecimal total = invoiceType.getLegalMonetaryTotal().getPayableAmount().getValue();
        CurrencyDecimal totalCurrency = new CurrencyDecimal(total, invoiceTypeCurrency, locale);
        template.addToken(new Token(TextLabel.INV_TOTAL_LABEL.toLowerCase(),
                TextLabel.INV_TOTAL_LABEL.toString(locale)));
        template.addToken(new Token(TextLabel.INV_TOTAL.toLowerCase(), totalCurrency.format()));
    }

    private void addTaxTotalTokens() {
        if (invoiceType.getTaxTotal().size() > 0) {
            TaxTotalType taxTotalType = invoiceType.getTaxTotal().get(0);
View Full Code Here

Examples of com.plainsource.commons.text.NumberWrapper.format()

                            TextLabel.INV_ITEM_UNIT.toLowerCase(), unitCode));
                } else {
                    template.addToken(new Token(TextLabel.INV_ITEM_UNIT.toLowerCase(), unitCode));
                }
                invoiceLineTokens.addToken(new Token(
                        TextLabel.INV_ITEM_QUANTITY.toLowerCase(), quantity.format()));
            }

            // Item Price
            PriceType price = quantityConverter.getPriceType();
            PriceAmountType priceAmount = null;
View Full Code Here

Examples of com.skaringa.util.ISO8601DateFormat.format()

   */
  public void testFormat() {
    Calendar cal = new GregorianCalendar(1962, 0, 19);
    cal.setTimeZone(TimeZone.getTimeZone("GMT+01"));
    ISO8601DateFormat formatter = new ISO8601DateFormat();
    String res = formatter.format(cal.getTime());

    assertEquals(
      "ISO 8601 date formatter produces wrong output",
      "1962-01-19",
      res);
View Full Code Here

Examples of com.skaringa.util.ISO8601DateTimeFormat.format()

    TimeZone tz = TimeZone.getTimeZone("GMT+01");
    Calendar cal = Calendar.getInstance(tz);
    cal.set(1962, Calendar.JANUARY, 19, 8, 40, 0);
    ISO8601DateTimeFormat formatter = new ISO8601DateTimeFormat(tz);

    String res = formatter.format(cal.getTime());

    assertEquals(
      "ISO 8601 date formatter produces wrong output",
      "1962-01-19T08:40:00+01:00",
      res);
View Full Code Here

Examples of com.sun.faban.common.TextTable.format()

                    bfw_metrics.write(inputTime.format(timeInputBuffer).toString());
                    bfw_metrics.write(outputBuffer.toString());
                    bfw_metrics.write(outputTime.format(timeOutputBuffer).toString());

                   
                    bfw_metrics.write(inputPeak.format(peakInputBuffer).toString());
                   
                    bfw_metrics.write(outputPeak.format(peakOutputBuffer).toString());

                    bfw_metrics.write(jobTable.format(pageBuffer).toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.