Here you can find the source of getSeparator(final NumberFormat format)
Parameter | Description |
---|---|
format | The format used for formatting numbers. |
public static char getSeparator(final NumberFormat format)
//package com.java2s; /*/*from w w w.j a v a 2 s . c o m*/ * Geotoolkit.org - An Open Source Java GIS Toolkit * http://www.geotoolkit.org * * (C) 2009-2012, Open Source Geospatial Foundation (OSGeo) * (C) 2009-2012, Geomatys * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ import java.text.NumberFormat; import java.text.DecimalFormat; public class Main { /** * Returns the separator to use between numbers. Current implementation returns the coma * character, unless the given number already use the coma as the decimal separator. * * @param format The format used for formatting numbers. * @return The character to use as a separator between numbers. * * @since 3.11 */ public static char getSeparator(final NumberFormat format) { if (format instanceof DecimalFormat) { final char c = ((DecimalFormat) format).getDecimalFormatSymbols().getDecimalSeparator(); if (c == ',') { return ';'; } } return ','; } }