github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/commands/cast.md (about)

     1  # `cast`
     2  
     3  > Alters the data type of the previous function without altering it's output
     4  
     5  ## Description
     6  
     7  `cast` works a little like when you case variables in lower level languages
     8  where the value of the variable is unchanged. In Murex the contents in
     9  the pipeline are preserved however the reported data type is altered.
    10  
    11  ## Usage
    12  
    13  ```
    14  <stdin> -> cast data-type -> <stdout>
    15  ```
    16  
    17  ## Examples
    18  
    19  ```
    20  ยป out {"Array":[1,2,3],"Map":{"String": "Foobar","Number":123.456}} -> cast json
    21  {"Array":[1,2,3],"Map":{"String": "Foobar","Number":123.456}}
    22  ```
    23  
    24  ## Detail
    25  
    26  If you want to reformat the STDIN into the new data type then use `format`
    27  instead.
    28  
    29  ## See Also
    30  
    31  * [`format`](../commands/format.md):
    32    Reformat one data-type into another data-type
    33  * [`out`](../commands/out.md):
    34    Print a string to the STDOUT with a trailing new line character
    35  * [`tout`](../commands/tout.md):
    36    Print a string to the STDOUT and set it's data-type
    37  
    38  <hr/>
    39  
    40  This document was generated from [builtins/core/typemgmt/types_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/typemgmt/types_doc.yaml).