Appearance
DoubleExtensions Class
Definition
Extenstions for the double datatype
- Namespace:
JASE.Extensions - Assembly:
JASE.Primitives.dll
Fields
| Name | Description |
|---|---|
BitsInByte | Number of bits in one byte (8). |
BitSymbol | Symbol representing a bit (lowercase 'b'). |
BytesInGibiByte | Number of bytes in one gibibyte (1,073,741,824). |
BytesInGigaByte | Number of bytes in one gigabyte (1,000,000,000). |
BytesInKibiByte | Number of bytes in one kibibyte (1,024). |
BytesInKiloByte | Number of bytes in one kilobyte (1,000). |
BytesInMebiByte | Number of bytes in one mebibyte (1,048,576). |
BytesInMegaByte | Number of bytes in one megabyte (1,000,000). |
BytesInPebiByte | Number of bytes in one pebibyte (1,125,899,906,842,624). |
BytesInPetaByte | Number of bytes in one petabyte (1,000,000,000,000,000). |
BytesInTebiByte | Number of bytes in one tebibyte (1,099,511,627,776). |
BytesInTeraByte | Number of bytes in one terabyte (1,000,000,000,000). |
ByteSymbol | Symbol representing a byte (uppercase 'B'). |
ExabyteSymbol | Symbol for exabyte using the SI decimal system (10^18 bytes). |
ExbiByteSymbol | Symbol for exbibyte using the IEC binary system (2^60 bytes). |
GibiByteSymbol | Symbol for gibibyte using the IEC binary system (1,073,741,824 bytes). |
GigaByteSymbol | Symbol for gigabyte using the SI decimal system (1,000,000,000 bytes). |
KibiByteSymbol | Symbol for kibibyte using the IEC binary system (1,024 bytes). |
KiloByteSymbol | Symbol for kilobyte using the SI decimal system (1,000 bytes). |
MebiByteSymbol | Symbol for mebibyte using the IEC binary system (1,048,576 bytes). |
MegaByteSymbol | Symbol for megabyte using the SI decimal system (1,000,000 bytes). |
PebiByteSymbol | Symbol for pebibyte using the IEC binary system (1,125,899,906,842,624 bytes). |
PetaByteSymbol | Symbol for petabyte using the SI decimal system (1,000,000,000,000,000 bytes). |
TebiByteSymbol | Symbol for tebibyte using the IEC binary system (1,099,511,627,776 bytes). |
TeraByteSymbol | Symbol for terabyte using the SI decimal system (1,000,000,000,000 bytes). |
YobiByteSymbol | Symbol for yobibyte using the IEC binary system (2^80 bytes). |
YottaByteSymbol | Symbol for yottabyte using the SI decimal system (10^24 bytes). |
ZebiByteSymbol | Symbol for zebibyte using the IEC binary system (2^70 bytes). |
ZettaByteSymbol | Symbol for zettabyte using the SI decimal system (10^21 bytes). |
Properties
| Name | Description |
|---|---|
UnitSymbols | Gets a read-only list of unit symbols (e.g., "kB", "MB", "GiB") corresponding to each ByteSizeUnit enum value. |
Methods
| Name | Description |
|---|---|
ByteSizeUnit BinaryUnit(double d) | Returns the most appropriate unit for the value, based on thresholds. |
ByteSizeUnit DecimalUnit(double d) | Returns the most appropriate unit for the value, based on thresholds. |
string FormattedBinarySymbol(double d, int decimalPlaces = null, bool separators = null) | Returns a formatted string with value and unit symbol. |
string FormattedDecimalSymbol(double d, int decimalPlaces = null, bool separators = null) | Returns a formatted string with value and unit symbol. |
string FormattedUnitSymbol(double d, int decimalPlaces = null, bool separators = null) | Returns a formatted string with value and unit symbol. |
int Remainder(double input) | Returns the digits after the decimal point as an integer. (Example: 5.75 returns 75 |
string ToFixed(double input, int digits = null) | Mimics JavaScript Number.prototype.toFixed() method Primary use case is consistency in expression evaluations shared with front-end |
double ToGibiBytes(double d, int decimalPlaces = null) | Converts bytes to gibibytes (1 GiB = 1,073,741,824 bytes). |
double ToGigaBytes(double d, int decimalPlaces = null) | Converts bytes to gigabytes (1 GB = 1,000,000,000 bytes). |
double ToKibiBytes(double d, int decimalPlaces = null) | Converts bytes to kibibytes (1 KiB = 1024 bytes). |
double ToKiloBytes(double d, int decimalPlaces = null) | Converts bytes to kilobytes (1 KB = 1000 bytes). |
double ToMebiBytes(double d, int decimalPlaces = null) | Converts bytes to mebibytes (1 MiB = 1,048,576 bytes). |
double ToMegaBytes(double d, int decimalPlaces = null) | Converts bytes to megabytes (1 MB = 1,000,000 bytes). |
double ToPebiBytes(double d, int decimalPlaces = null) | Converts bytes to pebibytes (1 PiB = 1,125,899,906,842,624 bytes). |
double ToPetaBytes(double d, int decimalPlaces = null) | Converts bytes to petabytes (1 PB = 1,000,000,000,000,000 bytes). |
double ToTebiBytes(double d, int decimalPlaces = null) | Converts bytes to tebibytes (1 TiB = 1,099,511,627,776 bytes). |
double ToTeraBytes(double d, int decimalPlaces = null) | Converts bytes to terabytes (1 TB = 1,000,000,000,000 bytes). |
double ToUnit(double d, ByteSizeUnit unit) | Converts the double value from bytes into the specified unit. |
ByteSizeUnit Unit(double d) | Returns the most appropriate unit for the value, based on thresholds. |
string UnitSymbol(double d) | Returns the appropriate unit symbol for the given byte value based on dynamic thresholds. |
string UnitSymbolBinary(double d) | Returns the appropriate unit symbol for the given byte value based on dynamic thresholds. |
string UnitSymbolDecimal(double d) | Returns the appropriate unit symbol for the given byte value based on dynamic thresholds. |