SI2ToScaledString(Int64, Int32, String, String, Int64, Int64) Method
Turns the given number of units (e.g., bytes) into a textual representation with an appropriate unit scaling
and common named representation (e.g., KB, MB, GB, TB, etc.).
Namespace: Gemstone.UnitsAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static string ToScaledString(
long totalUnits,
int decimalPlaces,
string unitName,
string[]? symbolNames = null,
long minimumFactor = 1024,
long maximumFactor = 1152921504606846976
)
Public Shared Function ToScaledString (
totalUnits As Long,
decimalPlaces As Integer,
unitName As String,
Optional symbolNames As String() = Nothing,
Optional minimumFactor As Long = 1024,
Optional maximumFactor As Long = 1152921504606846976
) As String
public:
static String^ ToScaledString(
long long totalUnits,
int decimalPlaces,
String^ unitName,
array<String^>^ symbolNames = nullptr,
long long minimumFactor = 1024,
long long maximumFactor = 1152921504606846976
)
Gemstone.Units.SI2.ToScaledString = function(totalUnits, decimalPlaces, unitName, symbolNames, minimumFactor, maximumFactor);
- totalUnits Int64
- Total units to represent textually.
- decimalPlaces Int32
- Number of decimal places to display.
- unitName String
- Name of unit display (e.g., you could use "B" for bytes).
- symbolNames String (Optional)
- Optional SI factor symbol or name array to use during textual conversion, defaults to Symbols.
- minimumFactor Int64 (Optional)
- Optional minimum SI factor. Defaults to Kilo.
- maximumFactor Int64 (Optional)
- Optional maximum SI factor. Defaults to Exa.
StringA
String representation of the number of units.
The
symbolNames array needs one string entry for each defined SI item ordered from
least (
Kilo) to greatest (
Exa), see
Names or
Symbols
arrays for examples.
ArgumentOutOfRangeException | decimalPlaces cannot be negative. |
ArgumentOutOfRangeException | minimumFactor or maximumFactor is not defined in Factors array. |