mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 16:55:41 +00:00
💄Reformat files
This commit is contained in:
parent
e537b9c727
commit
a01ef63ab0
@ -18,7 +18,7 @@
|
||||
/// <param name="obj">The object to convert.</param>
|
||||
/// <returns>Returns the value converted to <see cref="T"/>.</returns>
|
||||
public static T To<T>(this IConvertible obj) =>
|
||||
(T) Convert.ChangeType(obj, typeof(T));
|
||||
(T)Convert.ChangeType(obj, typeof(T));
|
||||
|
||||
/// <summary>
|
||||
/// Converts the object to another type, returning the default value on failure.
|
||||
|
@ -21,7 +21,7 @@
|
||||
/// </summary>
|
||||
/// <param name="dateOfBirth">The date of birth.</param>
|
||||
public static int Age(this DateTime dateOfBirth) =>
|
||||
(int) (((DateTime.Today - TimeSpan.FromDays(1) - dateOfBirth.Date).TotalDays + 1) / 365.2425);
|
||||
(int)(((DateTime.Today - TimeSpan.FromDays(1) - dateOfBirth.Date).TotalDays + 1) / 365.2425);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a DateTime representing the first specified day in the current month
|
||||
@ -147,7 +147,7 @@
|
||||
public static long ToUnixTimeStamp(this DateTime time, bool useMillis = false)
|
||||
{
|
||||
TimeSpan difference = time - UnixEpoch;
|
||||
return (long) (useMillis ? difference.TotalMilliseconds : difference.TotalSeconds);
|
||||
return (long)(useMillis ? difference.TotalMilliseconds : difference.TotalSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -12,6 +12,7 @@
|
||||
public static class Int16Extensions
|
||||
{
|
||||
#region TimeSpan Returns
|
||||
|
||||
// TODO change
|
||||
|
||||
public static TimeSpan Days(this ushort number) =>
|
||||
@ -85,7 +86,7 @@
|
||||
/// <returns>Returns a <see cref="DateTime"/> representing <paramref name="timestamp"/> seconds since the Unix
|
||||
/// epoch.</returns>
|
||||
public static DateTime FromUnixTimestamp(this short timestamp, bool isMillis = false) =>
|
||||
((long) timestamp).FromUnixTimestamp(isMillis);
|
||||
((long)timestamp).FromUnixTimestamp(isMillis);
|
||||
|
||||
/// <summary>
|
||||
/// Converts the <see cref="UInt16"/> to a <see cref="Byte"/>[].
|
||||
@ -103,7 +104,6 @@
|
||||
public static byte[] GetBytes(this short number) =>
|
||||
BitConverter.GetBytes(number);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the <see cref="Int16"/> is a prime number.
|
||||
/// </summary>
|
||||
@ -111,7 +111,7 @@
|
||||
/// <returns>Returns <see langword="true"/> if <paramref name="number"/> is prime, <see langword="false"/>
|
||||
/// otherwise.</returns>
|
||||
public static bool IsPrime(this short number) =>
|
||||
((long) number).IsPrime();
|
||||
((long)number).IsPrime();
|
||||
|
||||
/// <summary>
|
||||
/// Gets an boolean value that represents this integer.
|
||||
|
@ -12,6 +12,7 @@
|
||||
public static class Int32Extensions
|
||||
{
|
||||
#region TimeSpan Returns
|
||||
|
||||
// TODO change
|
||||
|
||||
public static TimeSpan Days(this uint number) =>
|
||||
|
@ -12,6 +12,7 @@
|
||||
public static class Int64Extensions
|
||||
{
|
||||
#region TimeSpan Returns
|
||||
|
||||
// TODO change
|
||||
|
||||
public static TimeSpan Days(this ulong number) =>
|
||||
@ -123,7 +124,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
long boundary = (long) Math.Floor(Math.Sqrt(number));
|
||||
long boundary = (long)Math.Floor(Math.Sqrt(number));
|
||||
for (int i = 3; i <= boundary; i += 2)
|
||||
{
|
||||
if (number % i == 0)
|
||||
|
@ -68,7 +68,7 @@
|
||||
throw new ArgumentException("Type provided must be an Enum.", "T");
|
||||
}
|
||||
|
||||
return (T) Enum.Parse(t, value, ignoreCase);
|
||||
return (T)Enum.Parse(t, value, ignoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user