This class provides methods for converting VirtualLab objects to a string.
More...
|
| static string | ToString (Complex complexValue, PhysicalProperty physicalProperty=PhysicalProperty.NoUnit, int numberOfDigits=int.MaxValue, ComplexToStringConversionFormat conversionFormat=ComplexToStringConversionFormat.AmplitudePhase) |
| | Converts a complex value to a string. More...
|
| |
| static string | ToString (double doubleValue, PhysicalProperty physicalProperty=PhysicalProperty.NoUnit, int numberOfDigits=int.MaxValue) |
| | Converts a floating point number in double precision to a string. More...
|
| |
| static string | ToString (int integer, bool useGroupSeparator=false) |
| | Converts an integer value to a string. More...
|
| |
| static string | ToString (PhysicalValue physicalValue, int numberOfDigits=int.MaxValue, bool showPhysicalUnits=true, bool prependComment=false) |
| | Converts a physical value to a string. More...
|
| |
| static string | ToString (PhysicalValueComplex physicalValue, int numberOfDigits=int.MaxValue, bool showPhysicalUnits=true, bool prependComment=false, ComplexToStringConversionFormat conversionFormat=ComplexToStringConversionFormat.AmplitudePhase) |
| | Converts a complex physical value to a string. More...
|
| |
This class provides methods for converting VirtualLab objects to a string.
◆ ToString() [1/5]
Converts a complex value to a string.
- Parameters
-
| complexValue | The Complex value to convert. |
| physicalProperty | This optional parameter allows you to set the PhysicalProperty used for the output. For example a complex amplitude is formatted as “1 \(\mu\)V/m \(\cdot\) exp(i \(f = 10^{-a}\))” instead of “1e-6 \(\cdot\) exp(i \(f = 10^{-a}\))” if this parameter is set to PhysicalProperty.ElectricalField. |
| numberOfDigits | Optional parameter to set the number of digits shown in the string. If this parameter is not specified, the precision set in the Global Options dialog is used. |
| conversionFormat | Optional parameter to specify the format of the complex number. If you set this parameter to ComplexToStringConversionFormat.RealImaginary, the value is formatted as “{Real} + {Imaginary} \(\cdot\)i”. If you set it to ComplexToStringConversionFormat.AmplitudePhase (the default), the value is formatted as “{Amplitude} \(\cdot\) exp(i \(\cdot\){Phase})”. |
- Returns
- The complex value as string.
◆ ToString() [2/5]
| static string ToString |
( |
double |
doubleValue, |
|
|
PhysicalProperty |
physicalProperty = PhysicalProperty.NoUnit, |
|
|
int |
numberOfDigits = int.MaxValue |
|
) |
| |
|
static |
Converts a floating point number in double precision to a string.
- Parameters
-
| doubleValue | The double value to convert. |
| physicalProperty | This optional parameter allows you to set the PhysicalProperty used for the output. For example a wavelength is formatted as “532 nm” instead of “5.32e-7” if this parameter is set to PhysicalProperty.Length. |
| numberOfDigits | Optional parameter to set the number of digits shown in the string. If this parameter is not specified, the precision set in the Global Options dialog is used. |
- Returns
- The double value as string.
◆ ToString() [3/5]
| static string ToString |
( |
int |
integer, |
|
|
bool |
useGroupSeparator = false |
|
) |
| |
|
static |
Converts an integer value to a string.
- Parameters
-
| integer | The integer value to convert. |
| useGroupSeparator | If this optional parameter is set to true, the integer 1234567 is converted to “1'234'567”. |
- Returns
- The integer value as string.
◆ ToString() [4/5]
| static string ToString |
( |
PhysicalValue |
physicalValue, |
|
|
int |
numberOfDigits = int.MaxValue, |
|
|
bool |
showPhysicalUnits = true, |
|
|
bool |
prependComment = false |
|
) |
| |
|
static |
Converts a physical value to a string.
- Parameters
-
| physicalValue | The PhysicalValue object to convert. |
| numberOfDigits | Optional parameter to set the number of digits shown in the string. If this parameter is not specified, the precision set in the Global Options dialog is used. |
| showPhysicalUnits | If this optional parameter is set to false, no units are shown which can be useful if you want to to use the string in other programs not supporting physical units. For example a wavelength is then formatted as “5.32e-7” instead of “532 nm”. |
| prependComment | If this optional parameter is set to true, the comment of the physical value is prepended. This means that the string is formatted as “{Comment} of {Value [with units]}” (e. g. “wavelength of 300 nm”). |
- Returns
- The physical value as string.
◆ ToString() [5/5]
| static string ToString |
( |
PhysicalValueComplex |
physicalValue, |
|
|
int |
numberOfDigits = int.MaxValue, |
|
|
bool |
showPhysicalUnits = true, |
|
|
bool |
prependComment = false, |
|
|
ComplexToStringConversionFormat |
conversionFormat = ComplexToStringConversionFormat.AmplitudePhase |
|
) |
| |
|
static |
Converts a complex physical value to a string.
- Parameters
-
| physicalValue | The PhysicalValue object to convert. |
| numberOfDigits | Optional parameter to set the number of digits shown in the string. If this parameter is not specified, the precision set in the Global Options dialog is used. |
| showPhysicalUnits | If this optional parameter is set to false, no units are shown which can be useful if you want to to use the string in other programs not supporting physical units. |
| prependComment | If this optional parameter is set to true, the comment of the physical value is prepended. This means that the string is formatted as “{Comment} of {Value [with units]}” (e. g. “complex amplitude of 1 \(\cdot\)exp(2) V/m”). |
| conversionFormat | Optional parameter to specify the format of the complex number. If you set this parameter to ComplexToStringConversionFormat.RealImaginary, the value is formatted as “{Real} + {Imaginary} \(\cdot\)i”. If you set it to ComplexToStringConversionFormat.AmplitudePhase (the default), the value is formatted as “{Amplitude} \(\cdot\) exp(i \(\cdot\){Phase})”. |
- Returns
- The complex physical value as string.