n = Pm.CSng(value)
|value||(Single) Any valid numeric expression.|
The conversion functions can be used e.g. if you want some operation result to be expressed as a particular data type (rather than the default data type). For example, by using the CDbl or CSng method the calculation will be done in Double or Single data type in cases, when the integer type would normally be used for calcullations.
Use this method to provide conversion independent on local system settings from any other data type to the Single type. Conversion of string value, where the decimal separator is "period" or "comma", will be completed correctly in both cases. depending on the locale setting of your system. Compare with VBScript.CSng.
If the expression lies outside the acceptable range of the Single subtype, then an error occurs.
var n1 = Pm.CSng("3.14");
var n2 = Pm.CSng("3,14"); //In n1 is stored the same value as in n2