# To\_Numeric

**To\_Numeric**\
\
Convert input value into numeric

### Example 1:&#x20;

Step 1: Create an empty **to\_numeric\_example\_1** using AIOps studio as shown in the below screenshot. 

![Empty pipeline](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeSYk59CHqNgIIM4htP%2F-MeSYm49B8Nh2QPxqFNX%2FScreen%20Shot%202021-07-12%20at%206.50.38%20PM.png?alt=media\&token=64448daf-b371-48a5-a86d-6a7abda5760b)

Step 2: Add the following pipeline code/commands into the above-created pipeline as shown in the below screenshot:

You can copy the below code into your pipeline and execute that in your environment.\
\
\&#xNAN;*`##### This pipeline creates disk size in bytes as a dataset row. Pipeline uses`*\
*`##### dm function to_numeric to convert string data into numeric. Next uses`*\
*`##### mathematical operation to convert bytes to GB and displays both bytes`* \
*`##### and Gb to the output`*\
\
*`@dm:empty`* \
*`--> @dm:addrow disk_size_in_bytes = '10737418240'`*\
*`--> @dm:map attr = 'disk_size_in_bytes' & func = 'to_numeric'`* \
*`--> @dm:map from = 'disk_size_in_bytes' & to = 'disk_size_in_GB' & func = evaluate & expr = "disk_size_in_bytes/1024/1024/1024"`*\ <br>

![Pipeline code added to empty pipeline created](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeS_2SNKw51z9pwGPvD%2F-MeS_Pm6Io06R3KN82N5%2FScreen%20Shot%202021-07-12%20at%206.57.45%20PM.png?alt=media\&token=5a53a8a7-f69a-4952-884d-2564d993c8ca)

Step 3: Click verify button to make sure syntax and pipeline code is correct (as shown below)

![Pipeline code is verified using 'Verify' button as shown above.](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeS_kUpIDDqTAIQ9mDZ%2F-MeS_kc0zEIo158_z1Va%2FScreen%20Shot%202021-07-12%20at%206.59.04%20PM.png?alt=media\&token=1fb043c5-8763-42ab-aa95-3ae06fc8c4bb)

Step 4:  Click execute button and execute the pipeline. RDA will execute the pipeline without any errors (as shown below)

![Successful execution of pipeline without any errors](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeS_r7bQXAWLQLNhEjU%2F-MeSa9e7ayAOUyay_cIG%2FScreen%20Shot%202021-07-12%20at%207.01.02%20PM.png?alt=media\&token=177e434a-e27e-4b31-b5cb-449b1af2b11d)

Step 5: RDA uses the dm function to\_numeric to convert string data into numeric, which in turn is used to convert disk size that was in bytes to convert to GB as shown in the output.\
&#x20;This function will be useful when the dataset contains strings that need to be converted to numeric and perform some mathematical logic similar to the above-explained example.

![Successful execution of pipeline using dm function 'to\_numeric' and prints output in Gb](https://2978683539-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LhoMVYxiQlKXh6OxX98%2F-MeSacQw92729faJGVQI%2F-MeSb-4Sx8qBQQp1HgId%2FScreen%20Shot%202021-07-12%20at%207.04.39%20PM.png?alt=media\&token=2895c2ea-44bf-4e7d-99a1-1e2ac0323027)
