UtilDigitalInformationConvertSize Method
Convert between sizes based in bytes.
Namespace: DevCase.Core.IO.DigitalInformationAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
No code example is currently available or this language may not be supported.
- size Double
-
The source size to convert.
- fromUnit DigitalStorageUnits
-
From unit of size.
- toUnit DigitalStorageUnits
-
To unit of size.
Double
The resulting value of the size conversion.
This is a code example.
No code example is currently available or this language may not be supported.
Dim byteToByte As Double = UtilNumerics.Convertsize(92928374, SizeUnits.Byte, SizeUnits.Byte)
Dim byteToKb As Double = UtilNumerics.Convertsize(92928374, SizeUnits.Byte, SizeUnits.Kilobyte)
Dim byteToMb As Double = UtilNumerics.Convertsize(92928374, SizeUnits.Byte, SizeUnits.Megabyte)
Console.WriteLine(String.Format("92928374 bytes = {0} Bytes", byteToByte.ToString("n0"))) ' Result: 92.928.374 Bytes
Console.WriteLine(String.Format("92928374 bytes = {0} KB", byteToKb.ToString("n2"))) ' Result: 90.750,37 KB
Console.WriteLine(String.Format("92928374 bytes = {0} MB", byteToMb.ToString("n2"))) ' Result: 88,62 MB
Dim gbToByte As Double = UtilNumerics.Convertsize(50, SizeUnits.Gigabyte, SizeUnits.Byte)
Dim gbToKb As Double = UtilNumerics.Convertsize(50, SizeUnits.Gigabyte, SizeUnits.Kilobyte)
Dim gbToMb As Double = UtilNumerics.Convertsize(50, SizeUnits.Gigabyte, SizeUnits.Megabyte)
Console.WriteLine(String.Format("50 GB = {0} Bytes", gbToByte.ToString("n2"))) ' Result: 53.687.091.200,00 Bytes
Console.WriteLine(String.Format("50 GB = {0} KB", gbToKb.ToString("n2"))) ' Result: 52.428.800,00 KB
Console.WriteLine(String.Format("50 GB = {0} MB", gbToMb.ToString("n2"))) ' Result: 51.200,00 MB
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.