public IntegerConverter() { this(DecimalFormat.getIntegerInstance()); }
public ShortConverter() { this(DecimalFormat.getIntegerInstance()); }
public LongConverter() { this(DecimalFormat.getIntegerInstance()); }
public ByteConverter() { this(DecimalFormat.getIntegerInstance()); }
public NaturalNumberConverter() { this(DecimalFormat.getIntegerInstance()); }
public static String getCurrencyString(long value) { NumberFormat numberFormat = DecimalFormat.getIntegerInstance(); String text = numberFormat.format(value) + " C-Bills"; return text; }
public String getCurrentlyLoadedClasses() { return DecimalFormat.getIntegerInstance().format(this.currentlyLoadedClasses); }
public String getTotalLoadedClasses() { return DecimalFormat.getIntegerInstance().format(this.totalLoadedClasses); }
public String getTotalUnloadedClasses() { return DecimalFormat.getIntegerInstance().format(this.totalUnloadedClasses); }
/** * Creates a new column that is based on the {@link ICounter} for the given * entity. * * @param entity * counter entity for this column * @param locale * locale for rendering numbers * @param comparator * comparator for the nodes of this column */ protected CounterColumn(final CounterEntity entity, final Locale locale, final Comparator<ICoverageNode> comparator) { this.entity = entity; this.integerFormat = DecimalFormat.getIntegerInstance(locale); this.comparator = new TableItemComparator(comparator); }
public void addFunds(long quantity, String description, int category) { if (description == null || description.isEmpty()) { description = "Rich Uncle"; } if (category == -1) { category = Transaction.C_MISC; } finances.credit(quantity, category, description, calendar.getTime()); NumberFormat numberFormat = DecimalFormat.getIntegerInstance(); String quantityString = numberFormat.format(quantity); addReport("Funds added : " + quantityString + " (" + description + ")"); }
@Override protected int finish(final CommandMap command) { for (final Entry<String, Collection<Long>> badIdsForCountry : this.countryToOSMids.asMap() .entrySet()) { try (PrintStream stream = outputFor(badIdsForCountry.getKey(), command)) { stream.println(badIdsForCountry.getValue().stream().sorted().map(String::valueOf) .collect(Collectors.joining("\n"))); } } final long totalErrors = this.countryToOSMids.asMap().values().parallelStream() .flatMap(Collection::parallelStream).count(); final NumberFormat formatter = DecimalFormat.getIntegerInstance(); logger.info("Completed: {} atlas files and found {} errors from {} countries took {}", formatter.format(this.atlasFiles), formatter.format(totalErrors), formatter.format(this.countryToOSMids.keySet().size()), this.start.elapsedSince()); return 0; }
public String getShortDescription() { String desc = getName() + " - "; if(cash > 0) { desc += DecimalFormat.getIntegerInstance().format(cash) + " C-bills"; } if(units.size() > 0) { String s = units.size() + " unit"; if(units.size() > 1) { s += "s"; } if(cash > 0) { s = ", " + s; } desc += s; } if(parts.size() > 0) { String s = parts.size() + " part"; if(parts.size() > 1) { s += "s"; } if(cash > 0 || units.size() > 0) { s = ", " + s; } desc += s; } return desc; }
public AbstractClearCaseScm(final String viewName, final String mkviewOptionalParam, final boolean filterOutDestroySubBranchEvent, final boolean useUpdate, final boolean rmviewonrename, final String excludedRegions, final boolean useDynamicView, final String viewDrive, final String loadRules, final String multiSitePollBuffer, final boolean createDynView, final String winDynStorageDir, final String unixDynStorageDir, final boolean freezeCode, final boolean recreateView, final String viewPath) { Validate.notNull(viewName); this.viewName = viewName; this.mkviewOptionalParam = mkviewOptionalParam; this.filteringOutDestroySubBranchEvent = filterOutDestroySubBranchEvent; this.useUpdate = useUpdate; this.removeViewOnRename = rmviewonrename; this.excludedRegions = excludedRegions; this.useDynamicView = useDynamicView; this.viewDrive = viewDrive; this.loadRules = loadRules; if (multiSitePollBuffer != null) { try { this.multiSitePollBuffer = DecimalFormat.getIntegerInstance().parse(multiSitePollBuffer).intValue(); } catch (ParseException e) { this.multiSitePollBuffer = 0; } } else { this.multiSitePollBuffer = 0; } this.createDynView = createDynView; this.winDynStorageDir = winDynStorageDir; this.unixDynStorageDir = unixDynStorageDir; this.freezeCode = freezeCode; this.recreateView = recreateView; this.viewPath = StringUtils.defaultIfEmpty(viewPath, viewName); }
@Override @SideOnly(Side.CLIENT) public void addDetails(ItemStack itemstack, EntityPlayer player, @Nullable World worldIn, List<String> infos) { infos.add(String.format("%s/%s %s", DecimalFormat.getIntegerInstance().format(getMatter(itemstack)), getMaxMatter(itemstack), MatterHelper.MATTER_UNIT)); if (itemstack.getTagCompound() != null) { ItemStack s; NBTTagList list = itemstack.getTagCompound().getTagList("Items", Constants.NBT.TAG_COMPOUND); for (int i = 0; i < list.tagCount(); i++) { s = new ItemStack(list.getCompoundTagAt(i)); infos.add(TextFormatting.GRAY + s.getDisplayName()); } } }
@Override public boolean configure(StaplerRequest req, JSONObject json) { defaultViewName = fixEmpty(req.getParameter("clearcase.defaultViewName").trim()); defaultViewPath = fixEmpty(req.getParameter("clearcase.defaultViewPath").trim()); defaultWinDynStorageDir = fixEmpty(req.getParameter("clearcase.defaultWinDynStorageDir").trim()); defaultUnixDynStorageDir = fixEmpty(req.getParameter("clearcase.defaultUnixDynStorageDir").trim()); String mergeTimeWindow = fixEmpty(req.getParameter("clearcase.logmergetimewindow")); if (mergeTimeWindow != null) { try { changeLogMergeTimeWindow = DecimalFormat.getIntegerInstance().parse(mergeTimeWindow).intValue(); } catch (ParseException e) { changeLogMergeTimeWindow = DEFAULT_CHANGE_LOG_MERGE_TIME_WINDOW; } } else { changeLogMergeTimeWindow = DEFAULT_CHANGE_LOG_MERGE_TIME_WINDOW; } save(); return true; }
/** * Creates a new column that is based on the {@link ICounter} for the given * entity. * * @param entity * counter entity for visualization * @param locale * locale for rendering numbers */ public BarColumn(final CounterEntity entity, final Locale locale) { this.entity = entity; this.integerFormat = DecimalFormat.getIntegerInstance(locale); this.comparator = new TableItemComparator(CounterComparator.MISSEDITEMS .reverse().on(entity) .second(CounterComparator.TOTALITEMS.reverse().on(entity))); }
public ExporterFormatter(Locale locale) { this.locale = locale; this.dateTimeFormat = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, locale); this.dateFormat = (SimpleDateFormat) SimpleDateFormat.getDateInstance(DateFormat.MEDIUM, locale); this.timeFormat = (SimpleDateFormat) SimpleDateFormat.getTimeInstance(DateFormat.SHORT, locale); this.decimalFormat = (DecimalFormat) DecimalFormat.getInstance(locale); this.integerFormat = (DecimalFormat) DecimalFormat.getIntegerInstance(locale); this.currencyFormat = (DecimalFormat) DecimalFormat.getCurrencyInstance(locale == Locale.ENGLISH ? Locale.US : locale); this.cellDateTimeFormat = DateFormatConverter.convert(locale, dateTimeFormat.toPattern()); this.cellDateFormat = DateFormatConverter.convert(locale, dateFormat.toPattern()); this.cellTimeFormat = DateFormatConverter.convert(locale, timeFormat.toPattern()); this.cellDecimalFormat = DateFormatConverter.convert(locale, decimalFormat.toPattern()); this.cellIntegerFormat = DateFormatConverter.convert(locale, integerFormat.toPattern()); this.cellCurrencyFormat = DateFormatConverter.convert(locale, getCurrencyFormatString()); }
@Override protected NumberSymbols createObject(Locale locale, NumberType numberType, Object... params) throws Exception { DecimalFormat df = null; switch (numberType) { case INTEGER: df = (DecimalFormat) DecimalFormat.getIntegerInstance(locale); break; case PERCENT: df = (DecimalFormat) DecimalFormat.getPercentInstance(locale); break; case DECIMAL: default: df = (DecimalFormat) DecimalFormat.getNumberInstance(locale); break; } DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); return new NumberSymbols(numberType, df.getNegativePrefix(), df.getNegativeSuffix(), df.getPositivePrefix(), df.getPositiveSuffix(), df.getGroupingSize(), dfs.getGroupingSeparator(), dfs.getDecimalSeparator()); } };