Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

int

Suggest changes
Table of contents

Prototype:int(string)

Return type:int

Description: Convert numeric string to int.

Arguments:

  • string:string - Numeric string to convert to integer - in the range:.*

Ifstring represents a floating point number then the decimals aretruncated.

Example:

code
bundleagentmain{vars:"data"data=>'{"acft_name":"A320neo","engine_num":"2","price_in_USD":"123.456789k"}';"engines"int=>int("$(data[engine_num])");"ballpark_price"int=>int("$(data[price_in_USD])");reports:"A320neo has$(engines) engines and costs about$(ballpark_price) USD.";}
code
R: A320neo has 2 engines and costs about 123456 USD.

This policy can be found in/var/cfengine/share/doc/examples/int.cfand downloaded directly fromgithub.

See also:string()

History:

  • Introduced in 3.18.0

Still need help?

Chat Ask a question on Github Mailing list
Version 
master3.24 (LTS)3.21 (LTS)view all versions

[8]ページ先頭

©2009-2025 Movatter.jp