Information

This site will undergo a brief period of maintenance on Friday, 18 December at 12:30 AM Central/12:00 PM IST. During a 30 minute window, site availability may be intermittent.

$scale (parse-spec, fmultiplier, foffset) function


Scale the parsed value specified by the first argument by multiplying the value with the fmultiplier floating point number of the second argument and then adding the foffset floating point number of the third argument. All three arguments are required. The result is an integer number rounded down to the nearest integer value. 

Warning

Note

The arguments can be either integer or floating point numbers, and the fmultipler value can be used to divide the number. The parsed value must be numeric (either integer or floating point number) or no match occurs.


Target string

Parse expression

Return value

N1: 2000

$scale( n1: *, 0.5, 0)

1000

The parsed value is multiplied by 0.5, that is, is divided by two.

P1: 20KB


$scale(

p1: *, 10, -50)

150

The parse value (not including KB units) is multiplied by 10 and then 50 is subtracted.

Q1: 24.999

 

$scale(

Q1: *, 2, 0)

49

The parse value is parsed as a floating point number, multiplied by two, then rounded down to the nearest integer

R1: Test

$scale(r1: *, 1, 0)

No match. The parsed value is not an integer number.

Related topic

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Command Center for Security 6.0