# Converting String to a Number

**URL:** <https://cl.desmos.com/t/converting-string-to-a-number/1767>\
**Category:** Questions\
**Created:** [October 23, 2020, 5:47pm UTC](https://cl.desmos.com/t/converting-string-to-a-number/1767 "2020-10-23T17:47:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jenn\_Vadnais](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jenn_vadnais/32/48_2.png) [@Jenn\_Vadnais](https://cl.desmos.com/u/Jenn_Vadnais)\
**Post date:** [October 23, 2020, 5:47pm UTC](https://cl.desmos.com/t/converting-string-to-a-number/1767/1 "2020-10-23T17:47:10Z")

</div>

In CL, is it possible to take a number and convert it to a string? I’d like to take the result of lhs = `${parseEquation(input.latex).lhs}` and compare it to a number.

Thank you.  
JV

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [October 23, 2020, 9:20pm UTC](https://cl.desmos.com/t/converting-string-to-a-number/1767/2 "2020-10-23T21:20:13Z")

</div>

I don’t think you need the ${ } here, but regardless better to check latex than a string. Is this what you want?

```auto
lhs=parseEquation(input.latex).lhs #this outputs latex
check= lhs='5'

```

`check` here will output true if the left hand side is 5.

OR converting lhs to a number

```auto
number= numericValue("${lhs}")

```

---

<div class="post-metadata">

**Author:** ![Jenn\_Vadnais](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jenn_vadnais/32/48_2.png) [@Jenn\_Vadnais](https://cl.desmos.com/u/Jenn_Vadnais)\
**Post date:** [October 28, 2020, 10:19pm UTC](https://cl.desmos.com/t/converting-string-to-a-number/1767/3 "2020-10-28T22:19:29Z")

</div>

This is super helpful. Thank you, Daniel.
