github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/cast.en.md (about) 1 ### `cast()` {#fn-cast} 2 3 Function prototype: `fn cast(key, dst_type: str)` 4 5 Function description: Convert the key value to the specified type 6 7 Function parameters: 8 9 - `key`: key name 10 - `type`:The target type of conversion, support `\"str\", \"float\", \"int\", \"bool\"` 11 12 Example: 13 14 ```python 15 # input data: {"first": 1,"second":2,"third":"aBC","forth":true} 16 17 # script 18 json(_, first) 19 cast(first, "str") 20 21 # result 22 { 23 "first": "1" 24 } 25 ```