Skip to main content
Version: v0.18.0

ConvertSizeUnits

Alias:ConvertSizeUnits, ConvertFileSize

Output:StringStream

Convert a string representing a data size to a string representing the same size but with different units.

ParameterTypeRequiredPositionSummary
String
From
string✔1The string containing the original value and units
Units
To
SizeUnit✔2The units to convert to

Examples​

Example 1​

Basic Replacement

SCL​

ConvertSizeUnits '1024 Kb' SizeUnit.Megabytes

Expected Output​

1.00 MB

Example 2​

Basic Replacement

SCL​

ConvertSizeUnits '1024' SizeUnit.Kilobytes

Expected Output​

1.00 KB

Example 3​

Basic Replacement

SCL​

ConvertSizeUnits '10 Kb' SizeUnit.Bytes

Expected Output​

10240.00 B

Example 4​

Basic Replacement

SCL​

ConvertSizeUnits '1.5 Kb' SizeUnit.Bytes

Expected Output​

1536.00 B

Example 5​

Basic Replacement

SCL​

ConvertFileSize From: '250 Kb' To: SizeUnit.Megabytes

Expected Output​

0.24 MB