Migrated Documentation library from NetFlow.DocumentationHelper.Library

This commit is contained in:
2026-01-28 13:15:44 +00:00
parent ab700413fb
commit d20a80c44c
152 changed files with 714 additions and 94 deletions
+26 -1
View File
@@ -1,14 +1,39 @@
using System;
using OmegaLeo.HelperLib.Shared.Attributes;
namespace GameDevLibrary.Extensions
namespace OmegaLeo.HelperLib.Extensions
{
[Documentation(nameof(FloatExtensions), "Provides extension methods for the float data type.", null,
"")]
[Changelog("1.2.0", "Fixed root namespace to OmegaLeo.HelperLib.Extensions.", "January 28, 2026")]
public static class FloatExtensions
{
[Documentation(nameof(Round), "Rounds a float value to the specified number of decimal places.",
new[]
{
"value: The float value to round.",
"digits: The number of decimal places to round to. Default is 2."
},
@"```cs
var originalValue = 3.14159f;
var roundedValue = originalValue.Round(2); // roundedValue will be 3.14
```
")]
public static float Round(this float value, int digits = 2)
{
return MathF.Round(value, digits);
}
[Documentation(nameof(RoundToInt), "Rounds a float value to the nearest integer and returns it as an int.",
new[]
{
"value: The float value to round.",
},
@"```cs
var originalValue = 3.14159f;
var roundedValue = originalValue.RoundToInt(); // roundedValue will be 3
```
")]
public static int RoundToInt(this float value)
{
return (int)value.Round(0);