Script functions reference > Script functions in alphabetical order > I > IsAmountValue

IsAmountValue
Syntax
IsAmountValue(str_amount, thousand_sep, decimal_sep);
str_amount
thousand_sep
decimal_sep
Description
Checks if a string expression is in ‘amount’ format. ‘Amount’ format is a string in the format commonly used to represent e.g. monetary amounts, for example 12,345,678.90
The thousand separator is only allowed every three digits, except in the beginning or at the end of the number. There cannot be any thousand separator after the decimal separator.
For example amountvalue("1,200.65", ",", ".");
For comparison, amountvalue("1,2000.65", ",", "."); is not a valid conversion.
If you leave the separator arguments empty, the separators are not checked. For example, if you leave the thousand separator argument empty, as in amountvalue("1200.65", "", "."); the number does not need to contain a thousand separator.
The numerical value can contain a minus sign (-) both at the beginning and at the end of the value. A plus sign (+) is only allowed in the beginning.
Returns
1
0
Example
$var="123,123.45";
if(isamountvalue($var,",","."))
{
$ok=1;
}
OpenText StreamServe 5.6 Updated: 2013-03-01