Caché MultiValue Basic Reference
SSUB
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

Subtracts two numeric strings.
Synopsis
SSUB(numstr1,numstr2)
Arguments
numstr1 The minuend. An expression that resolves to a number or numeric string.
numstr2 The subtrahend. An expression that resolves to a number or numeric string.
Description
The SSUB function subtracts numstr2 from numstr1, expressed as either numbers or as strings, and returns the result. Leading plus signs and leading and trailing zeros are ignored. A string is parsed as a number until a non-numeric character is encountered. Thus “7dwarves” is parsed as 7. Non-numeric strings and null strings are parsed as 0.
Arithmetic Operations
Examples
The following examples use the SSUB function to subtract two numeric strings. All of these examples return 4:
PRINT SSUB(7,3)
PRINT SSUB("7","3")
PRINT SSUB("+7.00","003")
PRINT SSUB("7dwarves","3wishes")
All of the following examples return 7:
PRINT SSUB(7,0)
PRINT SSUB("7","")
PRINT SSUB("7","three")
See Also