tiffany352 / rink-rs

Unit conversion tool and library written in rust
https://rinkcalc.app/about
GNU General Public License v3.0
441 stars 28 forks source link

Add more number output formats #180

Closed tiffany352 closed 4 months ago

tiffany352 commented 4 months ago

Adds to frac and to sci to explicitly force the use of these representations. Also adds to eng which behaves similar to the default behavior, except rounds to every third power of 10 instead of every power of 10. I might make the output format configurable and set the engineering one as the default in a future version.

While working on this I found a bug in the current version of rink. surveyfoot to digits is incorrect by 3 orders of magnitude. I fixed that in this PR.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 76.79%. Comparing base (c0aadc4) to head (f4eea03).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #180 +/- ## ========================================== + Coverage 76.09% 76.79% +0.70% ========================================== Files 41 41 Lines 7383 7425 +42 ========================================== + Hits 5618 5702 +84 + Misses 1765 1723 -42 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.