Skip to content

Add Double and Long extension methods with tests - #44

Merged
renepacios merged 1 commit into
mainfrom
feature/to_redeable_size
Nov 16, 2025
Merged

renepacios merged 1 commit into
mainfrom
feature/to_redeable_size

Conversation

@renepacios

Copy link
Copy Markdown
Owner

Introduce DoubleExtensions and LongExtensions classes in the System namespace to enhance double and long types.

  • DoubleExtensions includes TruncateDecimals to truncate doubles to a specified number of decimal places without rounding, handling cases with more than 15 decimals.

  • LongExtensions provides ToReadableSize methods to convert byte sizes to human-readable formats (KB, MB, GB, TB), supporting custom cultures.

  • Add unit tests in DoubleExtensionsTest.cs and LongExtensionsTest.cs using Xunit and FluentAssertions to cover various scenarios and ensure correct functionality.

Introduce `DoubleExtensions` and `LongExtensions` classes in the `System` namespace to enhance `double` and `long` types.

- `DoubleExtensions` includes `TruncateDecimals` to truncate doubles to a specified number of decimal places without rounding, handling cases with more than 15 decimals.

- `LongExtensions` provides `ToReadableSize` methods to convert byte sizes to human-readable formats (KB, MB, GB, TB), supporting custom cultures.

- Add unit tests in `DoubleExtensionsTest.cs` and `LongExtensionsTest.cs` using `Xunit` and `FluentAssertions` to cover various scenarios and ensure correct functionality.
@renepacios
renepacios merged commit c7df771 into main Nov 16, 2025
4 of 8 checks passed
@renepacios
renepacios deleted the feature/to_redeable_size branch November 16, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant