Package java.text

Examples of java.text.Format.format()


        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, dateFormatter.format(D1));
            ResultSet rs = statement.executeQuery();
            assertTrue(rs.next());
            assertEquals(dateFormatter.format(D1), rs.getString(2));
        } finally {
            conn.close();
View Full Code Here


        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, dateFormatter.format(D1));
            ResultSet rs = statement.executeQuery();
            assertTrue(rs.next());
            assertEquals(dateFormatter.format(D1), rs.getString(2));
        } finally {
            conn.close();
        }
    }
View Full Code Here

        }
        else
        {
            try
            {
                insert = format.format(value);
            }
            catch (Exception ex)
            {
                throw new ApplicationRuntimeException(ComponentMessages.unableToFormat(
                        this,
View Full Code Here

        }
        else
        {
            try
            {
                insert = format.format(value);
            }
            catch (Exception ex)
            {
                throw new ApplicationRuntimeException(ComponentMessages
                        .unableToFormat(this, value, ex), this, getBinding(
View Full Code Here

    /**
     * Add the date
     */
    Format format = new SimpleDateFormat("EEEE dd MMM yyyy");
    Paragraph dateParagraph = new Paragraph(format.format((new Date())), headerFont2);
    document.add(dateParagraph);
    document.add(twoEmptyLine);

    /**
     * Add the event name
View Full Code Here

        Format numberFormat = getFormat(cell);
        double d = cell.getNumericCellValue();
        if (numberFormat == null) {
            return String.valueOf(d);
        }
        return numberFormat.format(new Double(d));
    }

    /**
     * Formats the given raw cell value, based on the supplied
     *  format index and string, according to excel style rules.
View Full Code Here

            Format numberFormat = getFormat(value, formatIndex, formatString);
            if (numberFormat == null) {
                return String.valueOf(value);
            }
            // RK: This hack handles scientific notation by adding the missing + back.
            String result = numberFormat.format(new Double(value));
            if (result.contains("E") && !result.contains("E-")) {
                result = result.replaceFirst("E", "E+");
            }
            return result;
    }
View Full Code Here

        String result = null;

        Double value = getPositionAt(actuatorName);
        if (value != null) {
            Format decimalFormat = new DecimalFormat("0.000");
            result = decimalFormat.format(value);
        }
        return result;
    }

    public Double getPositionAt(String actuatorName) {
View Full Code Here

      startdate = toByteArray(value, 8, SPACE);
    }
   
    value = properties.getProperty("starttime", "").trim();
    if(value.toUpperCase().equals("AUTO")) {
      starttime = toByteArray(timeFormat.format(date), 8, SPACE);
    } else {
      starttime = toByteArray(value, 8, SPACE);
    }
   
    value = properties.getProperty("reserved", "").trim();
View Full Code Here

  public String getCurrentDateAsString(FacesContext context,
      UICalendar calendar, Date date) throws IOException {

    Format formatter = new SimpleDateFormat("MM/yyyy");
    return formatter.format(date);
  }

  public String getCurrentDate(FacesContext context, UICalendar calendar,
      Date date) throws IOException {
    return ScriptUtils.toScript(formatDate(date));
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.