Improve DefaultValueFormatter performance by larryxiao625 · Pull Request #5218 · PhilJay/MPAndroidChart

PR Checklist:

  • I have tested this extensively and it does not break any existing behavior.
  • I have added/updated examples and tests for any new behavior.
  • If this is a significant change, an issue has already been created where the problem / solution was discussed: [N/A, or add link to issue here]

PR Description

Improve DefaultValueFormatter performance

If the calculated number of digits has not changed, the DecimalFormat will not be reinitialized

As in #5217 describe, the DefaultValueFormatter will be calculated repeatedly and the DecimalFormat will be initialized. If there are a large number of icons on the interface, this will cause serious performance problems.