Examples of DecimalFormat


Examples of java.text.DecimalFormat

     */
    protected String getFileNameForTime(long l) {
        Calendar cal = new GregorianCalendar();
        cal.setTimeInMillis(l);

        DecimalFormat twoDigits = new DecimalFormat("00");

        String tMarker = Integer.toString(cal.get(Calendar.YEAR))
                + twoDigits.format(cal.get(Calendar.MONTH) + 1)
                + twoDigits.format(cal.get(Calendar.DAY_OF_MONTH))
                + twoDigits.format(cal.get(Calendar.HOUR_OF_DAY))
                + twoDigits.format(cal.get(Calendar.MINUTE))
                + twoDigits.format(cal.get(Calendar.SECOND));

        return tMarker + "."
                + getImageFormatter().getFormatLabel().toLowerCase();
    }
View Full Code Here

Examples of java.text.DecimalFormat

     */
    public Object clone() {
        OMDistance clone = (OMDistance) super.clone();
        clone.labels = new OMGraphicList();
        clone.points = new OMGraphicList();
        clone.df = new DecimalFormat("0.#");
        return clone;
    }
View Full Code Here

Examples of org.nxplanner.format.DecimalFormat

   private double captionValue;

   public static void main(String[] args) throws IOException {
        JFrame jFrame = new JFrame("Test");
        jFrame.setSize(800, 700);
        ProgressBarImage image = new ProgressBarImage(100, 20, 12.9, Color.BLUE, 16.8, Color.RED, new DecimalFormat(Locale.getDefault(), ""));
        FileOutputStream fos = new FileOutputStream( "c:\\temp\\pic.jpeg" );
        // BufferedOutputStream bos = new BufferedOutputStream( fos );
        image.encodeJPEG( fos, (float) 1.0 );
        fos.flush();
        fos.close();
View Full Code Here

Examples of org.outerj.i18n.DecimalFormat

            return null;
        }
    }

    public Object convertFromStringLocalized(String value, Locale locale) {
        DecimalFormat numberFormat = I18nSupport.getInstance().getIntegerFormat(locale);
        // TODO numberFormat.applyPattern(...)
        try {
            return new Long(numberFormat.parse(value).longValue());
        } catch (ParseException e) {
            return null;
        }
    }
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.