Promotic
WikipediaLinkedInYoutubeTwitterFacebook

CDbl - method of the Pm object

Description:
Returns an expression converted into a value of the Double type.

This method is obsolete (but functional) and it is better to use the Pm.ToNumber method.

Syntax:
Double CDbl(Double value)
Parameters:
value(Double) Any valid numeric expression.
Note:

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, use CDbl or CSng method to force the Double or Single data type in cases where integer arithmetic normally would occur.

Use this method to provide conversion independent on local system settings from any other data type to the value of the Double 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.CDbl.

 
If it is needed to convert the real number into the value of the String type regardless on local setting of OS Windows (i.e. the real number would always have "full stop" or "comma" as a decimal separator), then the Pm.TransformValue method can be used with parameter nType = 120, 121 or 122.
 
This method is also functional in Web panels.
Example:
JavaScriptVBScriptSelect and copy to clipboard

var n1 = Pm.CDbl("3.14");
var n2 = Pm.CDbl("3,14");  //In n1 is stored the same value as in n2
PROMOTIC 9.0.15 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- CDbl
 
 
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice