Custom method for converting a matrix into a string #159

Closed
vkostyukov opened this Issue Mar 12, 2014 · 2 comments

1 participant

@vkostyukov
Owner

People keep asking me regarding the fact that la4j prints out only first three significant digit. It's confusing. I would like to add a new method into the API that allows to specify how many significant digits should be printed out.

The overall picture should looks as follows:

(in Matrix interface)

String mkString(NumberFormat format);

So, by default it will print 3 significant digits.

@vkostyukov vkostyukov added this to the la4j-0.5.0 milestone Mar 12, 2014
@vkostyukov
Owner

This might be a default decimal format for la4j:

public static NumberFormat DEAULT_NUMBER_FORMAT = new DecimalFormat("0.000");
@vkostyukov
Owner

The typical use-case might be:

Matrix a = new Basic2DMatrix();
System.out.println(a.mkString(new DecimalFormat("000.#")));
@vkostyukov vkostyukov added a commit that referenced this issue Mar 22, 2014
@vkostyukov working on #159 50e9227
@vkostyukov vkostyukov added a commit that closed this issue Mar 22, 2014
@vkostyukov fixes #159 2ba6ce6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment