Aether Utilities Aether Utilities
Aether Utilities Aether Utilities
DocFX + Singulink = ♥

Search Results for

    Edit this page

    Class NumberExtensions

    Namespace
    AetherUtils.Core.Extensions
    Assembly
    AetherUtils.Core.dll
    Provides extension methods for manipulating various number objects.
    public static class NumberExtensions
    Inheritance
    object
    NumberExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()

    Methods

    FormatSize(ulong)

    Formats a size in bytes (represented by an ulong value) to the next closest base-2 size representation and appends its suffix to the end; uses 1024 as the conversion factor.
    public static string FormatSize(this ulong sizeInBytes)

    Parameters

    sizeInBytes ulong
    The size, in bytes, to format.

    Returns

    string
    The number formatted with its suffix as a string.

    ToInches(double, double)

    Get an absolute value in inches represented by the specified number of pixels.
    [UsedImplicitly]
    public static double ToInches(this double pixels, double dpi = 96)

    Parameters

    pixels double
    The number of pixels to convert.
    dpi double
    The DPI (dots per inch) of the screen; defaults to 96.

    Returns

    double
    The inches equivalent of the pixels.

    Exceptions

    DivideByZeroException
    If dpi was 0.

    ToPixels(double, double)

    Get an absolute value in pixels represented by the specified number of inches.
    [UsedImplicitly]
    public static double ToPixels(this double inches, double dpi = 96)

    Parameters

    inches double
    The number of inches to convert.
    dpi double
    The DPI (dots per inch) of the screen; default is 96.

    Returns

    double
    The pixels equivalent of the inches.
    (c) 2024 Ethan Hann. All rights reserved.