Example usage for org.apache.commons.math3.complex ComplexFormat ComplexFormat

List of usage examples for org.apache.commons.math3.complex ComplexFormat ComplexFormat

Introduction

In this page you can find the example usage for org.apache.commons.math3.complex ComplexFormat ComplexFormat.

Prototype

public ComplexFormat(String imaginaryCharacter, NumberFormat realFormat, NumberFormat imaginaryFormat)
        throws NullArgumentException, NoDataException 

Source Link

Document

Create an instance with a custom imaginary character, a custom number format for the real part, and a custom number format for the imaginary part.

Usage

From source file:com.autsia.bracer.BracerParser.java

/**
 * Set the precision of the real and imaginary parts of numbers
 *
 * @param precision Number of digits after the dot
 * @since 2.0/*from  w w  w  .  j  a  v  a 2  s.c om*/
 */
public void setPrecision(int precision) {
    numberFormat.setMinimumFractionDigits(precision);
    numberFormat.setMaximumFractionDigits(precision);
    complexFormat = new ComplexFormat(IMAGINARY, numberFormat, numberFormat);
}