4D v16.3Num |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
Num
Num
The Num command returns the numeric form of the String, Boolean or numeric expression you pass in expression. The optional separator parameter designates a decimal separator for evaluating string type expressions. String Expressions There are three reserved characters that Num treats specially: the decimal separator as defined in the system (if the separator parameter is not passed), the hyphen “-”, and “e” or “E”. These characters are interpreted as numeric format characters.
The separator parameter designates a custom decimal separator for evaluating the expression. When the string to be evaluated is expressed with a decimal separator different from the system operator, the command returns an incorrect result. The separator parameter can be used in this case to obtain a correct evaluation. When this parameter is passed, the command does not take the system decimal separator into account. You can pass one or more characters. Note: The GET SYSTEM FORMAT command can be used to find out the current decimal separator as well as several other regional system parameters. Boolean Expressions Numeric Expressions The following example illustrates how Num works when passed a string argument. Each line assigns a number to the vResult variable. The comments describe the results: vResult:=Num("ABCD") ` vResult gets 0 Here, [Client]Debt is compared with $1000. The Num command applied to these comparisons returns 1 or 0. Multiplying 1 or 0 with a string repeats the string once or returns the empty string. As a result, [Client]Risk gets either “Good” or “Bad”: ` If client owes less than 1000, a good risk. This example compares the results obtained depending on the “current” separator: $thestring:="33,333.33"
See also
|
PROPERTIES
Product: 4D HISTORY
Modified: 4D v11 SQL ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||