Skip to content

Cleaning FloatArrayFormatter #12164

Closed
Closed
@nbonnotte

Description

@nbonnotte

While working on issue #12031 (adding a decimal parameter to .to_latex() and .to_html()), I realized a solution would be pretty straight-forward if only FloatArrayFormatter was a bit cleaned.

Currently, there are two methods that do a similar work:

  • .get_formatted_data(), which returns the array with its float values converted to strings using the parameters given at initialisation.
  • .get_result(), which does something similar, but with a fixed-width output suitable for screen printing.

The two methods don't share any piece of code.

(The first method can already deal with a decimal parameter. The second cannot, and it is the one used by .to_latex.)

This is in part my fault, since my pull request #11681 could have been more factorized.

Anyway, I'm volunteering to do a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions