-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathObject.To.SingleLocal.cs
44 lines (36 loc) · 1.24 KB
/
Object.To.SingleLocal.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
namespace Ace.CSharp.Extensions;
public static partial class ObjectExtensions
{
public static float ToSingleLocal(this object? @this)
{
return ToSingle(@this, CultureInfo.CurrentCulture);
}
public static float ToSingleOrDefaultLocal(this object? @this, float @default = default)
{
return ToSingleOrDefault(@this, CultureInfo.CurrentCulture, @default);
}
public static float? ToSingleOrNullLocal(this object? @this)
{
return ToSingleOrNull(@this, CultureInfo.CurrentCulture);
}
public static bool TryConvertToSingleLocal(this object? @this, out float result)
{
return TryConvertToSingle(@this, CultureInfo.CurrentCulture, out result);
}
public static float ToFloatLocal(this object? @this)
{
return ToSingleLocal(@this);
}
public static float ToFloatOrDefaultLocal(this object? @this, float @default = default)
{
return ToSingleOrDefaultLocal(@this, @default);
}
public static float? ToFloatOrNullLocal(this object? @this)
{
return ToSingleOrNullLocal(@this);
}
public static bool TryConvertToFloatLocal(this object? @this, out float result)
{
return TryConvertToSingleLocal(@this, out result);
}
}