Java examples for java.lang:double Format
Returns a thousands separated decimal formatter.
//package com.java2s; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.Locale; public class Main { /**// www . j a va 2s.co m * Returns a thousands separated decimal formatter. * * @return */ public static DecimalFormat getThousandSeperatedDecimalFormat() { DecimalFormat df = (DecimalFormat) NumberFormat .getInstance(Locale.US); DecimalFormatSymbols symbols = df.getDecimalFormatSymbols(); symbols.setGroupingSeparator(' '); df.setDecimalFormatSymbols(symbols); return df; } }