public ConfusionMatrix(Locale locale) { format = new DecimalFormat(FORMAT, new DecimalFormatSymbols(locale)); }
//create a new instance DecimalFormatSymbols custom=new DecimalFormatSymbols(); custom.setDecimalSeparator(','); format.setDecimalFormatSymbols(custom);
private String formatTime(float time) { DecimalFormatSymbols symbols = new DecimalFormatSymbols(); // JUnitReports wants points here, regardless of the locale symbols.setDecimalSeparator('.'); DecimalFormat format = new DecimalFormat("#.###", symbols); format.setMinimumFractionDigits(3); return format.format(time / 1000.0f); }
DecimalFormat df = new DecimalFormat(); DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setDecimalSeparator(','); symbols.setGroupingSeparator(' '); df.setDecimalFormatSymbols(symbols); df.parse(p);
public static String format(final long v) { final DecimalFormat df = new DecimalFormat(); df.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); df.setGroupingSize(3); df.setMaximumFractionDigits(0); final String t = df.format(v).replace(',', ' '); return t; } }
public PointFormatter() { DecimalFormatSymbols dfSymbols = new DecimalFormatSymbols(); dfSymbols.setDecimalSeparator('.'); this.df.setDecimalFormatSymbols(dfSymbols); }
long fileLineNumber = 0; DecimalFormatSymbols dfs = new DecimalFormatSymbols(); DecimalFormatSymbols dfs2 = new DecimalFormatSymbols(); SimpleDateFormat daf2 = new SimpleDateFormat(); df2.setDecimalFormatSymbols( dfs2 ); double mn = df2.parse( seResult.getMin().toString() ).doubleValue(); message.append( BaseMessages.getString( PKG, "TextFileCSVImportProgressDialog.Info.NumberExample", mask,
DecimalFormat df = new DecimalFormat(); DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setDecimalSeparator('.'); symbols.setGroupingSeparator(','); df.setDecimalFormatSymbols(symbols); df.parse(p);
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(currentLocale); otherSymbols.setDecimalSeparator(','); otherSymbols.setGroupingSeparator('.'); DecimalFormat df = new DecimalFormat(formatString, otherSymbols);
FileSizeFormat( Locale locale ) { smallFormat = new DecimalFormat( "#0.0", new DecimalFormatSymbols( locale ) ); largeFormat = new DecimalFormat( "###0", new DecimalFormatSymbols( locale ) ); }
/** * Print the matrix to the output stream. Line the elements up in * columns with a Fortran-like 'Fw.d' style format. * * @param output Output stream. * @param w Column width. * @param d Number of digits after the decimal. */ public void print(PrintWriter output, int w, int d) { DecimalFormat format = new DecimalFormat(); format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); format.setMinimumIntegerDigits(1); format.setMaximumFractionDigits(d); format.setMinimumFractionDigits(d); format.setGroupingUsed(false); print(output, format, w + 2); }
NumberFormat nf = NumberFormat.getInstance(); DecimalFormat df = (DecimalFormat) nf; DecimalFormatSymbols dfs = new DecimalFormatSymbols(); dfs.setDecimalSeparator( decimalSymbol.charAt( 0 ) ); df.setDecimalFormatSymbols( dfs ); // in case of 4, 3 or 2 if ( format != null && format.length() > 0 ) { df.applyPattern( format );
private static DecimalFormatSymbols initializeDecimalFormatSymbols() { DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(); decimalFormatSymbols.setDecimalSeparator('.'); return decimalFormatSymbols; }
long fileLineNumber = 0; DecimalFormatSymbols dfs = new DecimalFormatSymbols(); DecimalFormatSymbols dfs2 = new DecimalFormatSymbols(); SimpleDateFormat daf2 = new SimpleDateFormat(); df2.setDecimalFormatSymbols( dfs2 ); double mn = df2.parse( seResult.getMin().toString() ).doubleValue(); message.append( BaseMessages.getString(
DecimalFormat twoDForm = new DecimalFormat("#.##"); DecimalFormatSymbols dfs = new DecimalFormatSymbols(); dfs.setDecimalSeparator('.'); twoDForm.setDecimalFormatSymbols(dfs);
private String formatTime(float time) { DecimalFormatSymbols symbols = new DecimalFormatSymbols(); // JUnitReports wants points here, regardless of the locale symbols.setDecimalSeparator('.'); DecimalFormat format = new DecimalFormat("#.###", symbols); format.setMinimumFractionDigits(3); return format.format(time / 1000.0f); }
private void printDuration(PrintStream out) { out.print(String.format("%dm", (totalDuration / ONE_MINUTE))); DecimalFormat format = new DecimalFormat("0.000", new DecimalFormatSymbols(locale)); out.println(format.format(((double) (totalDuration % ONE_MINUTE)) / ONE_SECOND) + "s"); }
formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs); formatter.applyLocalizedPattern(patternStr); formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs); formatter.applyLocalizedPattern(patternStr); dfs = new java.text.DecimalFormatSymbols(java.util.Locale.US); formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs);
public void guessType() { nf = NumberFormat.getInstance(); df = (DecimalFormat) nf; dfs = new DecimalFormatSymbols(); daf = new SimpleDateFormat(); if ( contains_dot && !contains_comma ) { // American style 174.5 dfs.setDecimalSeparator( '.' ); decimalSymbol = "."; dfs.setGroupingSeparator( ',' ); } else if ( !contains_dot && contains_comma ) { // European style 174,5 dfs.setDecimalSeparator( ',' ); decimalSymbol = ","; dfs.setGroupingSeparator( '.' ); int idx_com = field.indexOf( ',' ); if ( idx_dot > idx_com ) { dfs.setDecimalSeparator( '.' ); decimalSymbol = "."; dfs.setGroupingSeparator( ',' ); df.setDecimalFormatSymbols( dfs ); df.applyPattern( number_formats[x] );
Validate.notNull(locale, "Locale cannot be null"); final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US); symbols.setDecimalSeparator('.'); break; case COMMA : symbols.setDecimalSeparator(','); break; case WHITESPACE : symbols.setDecimalSeparator(' '); break; case DEFAULT : final DecimalFormatSymbols dfs = new DecimalFormatSymbols(locale); symbols.setDecimalSeparator(dfs.getDecimalSeparator()); break; break; case DEFAULT : final DecimalFormatSymbols dfs = new DecimalFormatSymbols(locale); symbols.setGroupingSeparator(dfs.getGroupingSeparator()); break;