UnitsNet icon indicating copy to clipboard operation
UnitsNet copied to clipboard

Making the `ToString` paramters optional (IFormattable)

Open lipchev opened this issue 8 months ago • 1 comments

  • removed the ToString(IFormatProvider?) overload from the IQuantity interface
  • removed the ToString overloads from the generated quantities (and HowMuch)
  • replaced the usages of ToString(IFormatProvider?) in the tests

duplicate of #1552

lipchev avatar Apr 19 '25 22:04 lipchev

Hm, I was expecting there to be a very small size difference compared to #1552, but

before: 2.19 MB (2 301 440 bytes) after: 2.18 MB (2 287 616 bytes) #1552 : 2.17 MB (2 286 080 bytes) 😮

I don't know what to make of these numbers..

Anyway, I was also a little surprised by the number of breaking changes that this caused in the tests (non-generated).. I initially found the ToString extensions a little awkward, but I now I think they might be the better option..

lipchev avatar Apr 19 '25 22:04 lipchev

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 20 '25 02:06 github-actions[bot]

This PR was automatically closed due to inactivity.

github-actions[bot] avatar Jun 27 '25 02:06 github-actions[bot]