List of usage examples for java.text NumberFormat getIntegerInstance
public static NumberFormat getIntegerInstance(Locale inLocale)
From source file:org.mycore.datamodel.ifs2.MCRStore.java
private String createIDWithLeadingZeros(final int ID) { final NumberFormat numWithLeadingZerosFormat = NumberFormat.getIntegerInstance(Locale.ROOT); numWithLeadingZerosFormat.setMinimumIntegerDigits(idLength); numWithLeadingZerosFormat.setGroupingUsed(false); final String id = numWithLeadingZerosFormat.format(ID); return id;//from w w w . j a v a 2 s .c o m }
From source file:com.mgmtp.perfload.perfalyzer.PerfAlyzerModule.java
@Provides @IntFormat// ww w . j a va 2 s .c o m NumberFormat provideIntFormat(final Locale locale) { NumberFormat nf = NumberFormat.getIntegerInstance(locale); nf.setGroupingUsed(false); nf.setRoundingMode(RoundingMode.HALF_UP); return nf; }