<commit_before>package de.ptb.epics.eve.viewer.pv;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.FieldPosition;
import java.text.ParsePosition;
import java.util.Formatter;
import java.util.Locale;

/**
 * A Modified {@link java.text.DecimalFormat} that uses 
 * {@link java.util.Formatter} for general scientific notation.
 * 
 * @author <NAME>
 * @since 1.1
 */
public class PVNumberFormat extends DecimalFormat {

	private static final long serialVersionUID = 1L;

	private DecimalFormat decimalFormat;
	
	public PVNumberFormat(String pattern) {
		Locale locale = new Locale("en");
		DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
		this.decimalFormat = new DecimalFormat(pattern, symbols);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public StringBuffer format(double number, StringBuffer toAppendTo,
			FieldPosition pos) {
		StringBuffer sb = new StringBuffer();
		Formatter formatter = new Formatter(
				new Locale(Locale.ENGLISH.getCountry()));
		sb.append(formatter.format("%14.6g", number).out().toString().trim());
		return sb;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public StringBuffer format(long number, StringBuffer toAppendTo, <commit_msg>setting number format in deviceInspectorView on %14.7g<commit_after>package de.ptb.epics.eve.viewer.pv;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.FieldPosition;
import java.text.ParsePosition;
import java.util.Formatter;
import java.util.Locale;

/**
 * A Modified {@link java.text.DecimalFormat} that uses 
 * {@link java.util.Formatter} for general scientific notation.
 * 
 * @author <NAME>
 * @since 1.1
 */
public class PVNumberFormat extends DecimalFormat {

	private static final long serialVersionUID = 1L;

	private DecimalFormat decimalFormat;
	
	public PVNumberFormat(String pattern) {
		Locale locale = new Locale("en");
		DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
		this.decimalFormat = new DecimalFormat(pattern, symbols);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public StringBuffer format(double number, StringBuffer toAppendTo,
			FieldPosition pos) {
		StringBuffer sb = new StringBuffer();
		Formatter formatter = new Formatter(
				new Locale(Locale.ENGLISH.getCountry()));
		sb.append(formatter.format("%14.7g", number).out().toString().trim());
		return sb;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public StringBuffer format(long number, StringBuffer toAppendTo, 
{'fraction_non_alphanumeric': 0.11509054325955734, 'fraction_numerical': 0.006036217303822937, 'mean_word_length': 4.808411214953271, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1896081', 'n_tokens_mistral': 794, 'n_tokens_neox': 728, 'n_words': 188}