Package java.text

Examples of java.text.DecimalFormat.format()


  {
    try {
      DecimalFormatSymbols dfsymbols = new DecimalFormatSymbols(context.getLocale());
      DecimalFormat df = new DecimalFormat(format, dfsymbols);
      if (typeOf() == IS_INT) {
        return Any.create(df.format(toLong()));
      } else {
        return Any.create(df.format(toDouble()));
      }
    } catch (IllegalArgumentException e) {
      throw context.BadParameter(e.getMessage());
View Full Code Here


      DecimalFormatSymbols dfsymbols = new DecimalFormatSymbols(context.getLocale());
      DecimalFormat df = new DecimalFormat(format, dfsymbols);
      if (typeOf() == IS_INT) {
        return Any.create(df.format(toLong()));
      } else {
        return Any.create(df.format(toDouble()));
      }
    } catch (IllegalArgumentException e) {
      throw context.BadParameter(e.getMessage());
    }
  }
View Full Code Here

        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));
View Full Code Here

        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 + "."
View Full Code Here

        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

        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

        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

        DecimalFormat formatter = new DecimalFormat("0.00");
       
        downValue = Math.round(downValue);
        double u = 1024 / 100D;
       
        min_file_size.setText(formatter.format(u * downValue));
       
      }

      public void upValueChanged(double upValue) {
        updated_file_size = true;
View Full Code Here

        DecimalFormat formatter = new DecimalFormat("0.00");
       
        upValue = Math.round(upValue);
        double u = 1024 / 100D;
       
        max_file_size.setText(formatter.format(u * upValue));
      }
    });
       
    Composite options_composite = new Composite(shell,SWT.NONE);
    layout_data = new GridData();
View Full Code Here

   
    // initialization
   
    DecimalFormat formatter = new DecimalFormat("0.00");
   
    min_file_size.setText(formatter.format(min));
    max_file_size.setText(formatter.format(max));
   
    min_file_size_units.select(initial_min_size_units);
    max_file_size_units.select(initial_max_size_units);
   
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.