# String to Float, but for Dummies

**URL:** <https://forum.inductiveautomation.com/t/string-to-float-but-for-dummies/108864>\
**Category:** Ignition\
**Created:** [July 23, 2025, 11:33pm UTC](https://forum.inductiveautomation.com/t/string-to-float-but-for-dummies/108864 "2025-07-23T23:33:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Project2501](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Project2501](https://forum.inductiveautomation.com/u/Project2501)\
**Post date:** [July 23, 2025, 11:33pm UTC](https://forum.inductiveautomation.com/t/string-to-float-but-for-dummies/108864/1 "2025-07-23T23:33:56Z")

</div>

Problem statement: I'm returning a string from a camera, I'm parsing the string into a dataset, and I'm left with 4 strings.

//Pre parsed:  
UC TEUUU S1.000 I51.5

//Post Parse  
UC  
TEUUU  
S1.000  
I51.5

Then I want to use that 4th value for some events so I want to convert it to a float and ditch the I.

This thread from 2012 is very helpful as it's same question.

> [@Dataset string to float](https://forum.inductiveautomation.com/t/dataset-string-to-float/5519):
>
> We are collecting data from a scale using the TCP driver, which gives us data back in the Message tag, and it comes back as a string that we have to parse. Once it’s parsed we end up with a few columns, and one of them is actual weight data, but it is still a String. We would like to Total, avg, chart, etc. that data. It works great in the Reporting module, but we can’t seem to get that data from a string, to a float so we can chart it. How would we go about taking a column in a dataset that…

But I don't have it going to a database outside of a Data List Tag that I've derived doing this:  
split({source}," ")

Then a reference tag that I built doing this:  
[.]Data List[3,0]

So I've isolated that value, and I want to make a tag that has the float result so I can alarm or do other process control things with it.

I understand the script from the 2012 thread, but am wondering do I perform that on the cell and then write that to a new (3rd?) tag? I think this is clunky because of my lack of knowledge and a smart kid would do it differently.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 24, 2025, 10:49am UTC](https://forum.inductiveautomation.com/t/string-to-float-but-for-dummies/108864/2 "2025-07-24T10:49:55Z")

</div>

Using a [substring() expression](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/string/substring) can help:  
`toFloat(substring({[.]Data List}[3,0],1))`

FWIW, using a UDT would be useful if you have more than one camera. Point the raw value at the camera input  
[udt\_Camera.json](https://forum.inductiveautomation.com/uploads/short-url/vAV9UEx98DSkxFRZMGEorADRMGl.json) (1.1 KB)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/b/bbdefb97ddf6c3ba29ea0fe344ec66d4bb64497c.png)

---

<div class="post-metadata">

**Author:** ![Project2501](https://avatars.discourse-cdn.com/v4/letter/p/41988e/32.png) [@Project2501](https://forum.inductiveautomation.com/u/Project2501)\
**Post date:** [July 24, 2025, 4:33pm UTC](https://forum.inductiveautomation.com/t/string-to-float-but-for-dummies/108864/3 "2025-07-24T16:33:17Z")

</div>

Yeah solved.Thank you.  
I agree on UDT, I have to stick build a working single tag first before I can optimize but that's just my inability to jump twice at once.

I didn't know I could directly convert from a list like that, this is really slick and I appreciate this. It opens up other options unrelated to this specific question as well.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 24, 2025, 4:41pm UTC](https://forum.inductiveautomation.com/t/string-to-float-but-for-dummies/108864/4 "2025-07-24T16:41:15Z")

</div>

Datasets, list-like sequences, and associative key/value pairs (aka maps, dictionaries) can all be extracted with 'subscript' syntax:

> **[Expression Language and Syntax | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/platform/expression-language-and-syntax#dataset-access)**
>
> Expression Language
