DSACMS / metrics

Experimentations in Open Source Repository Metrics
https://dsacms.github.io/metrics/
Other
6 stars 2 forks source link

Fix Issue with Proper Significant Digits not Being Shown in Reports #106

Closed IsaacMilarky closed 3 months ago

IsaacMilarky commented 3 months ago

Fix Issue with Proper Significant Digits not Being Shown in Reports

Problem

Smaller percentage values in the repo and org reports weren't being displayed properly. If the change percent was less than 10 the proper number of sigificant figures (2) were not being shown.

image

This PR closes #85

Solution

Added a method to format the percentage value by casting the float value to a string and using format string methods. This way no extra modules such as math are included.