# String to number

**URL:** https://discourse.nodered.org/t/string-to-number/988
**Category:** General
**Created:** [21 June 2018 15:25 UTC](https://discourse.nodered.org/t/string-to-number/988 "2018-06-21T15:25:51Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [21 June 2018 15:34 UTC](https://discourse.nodered.org/t/string-to-number/988/2 "2018-06-21T15:34:00Z")

</div>

The Node-RED Function node uses JavaScript. A quick google search for how to do that will reveal lots of answers, for example:

> **[Converting strings to numbers with vanilla JavaScript](https://gomakethings.com/converting-strings-to-numbers-with-vanilla-javascript/)**
>
> In JavaScript, you can represent a number is an actual number (ex. 42), or as a string (ex. '42').
> If you were to use a strict comparison to compare the two, it would fail because they’re two different types of objects.
> var num1 = 42; var num2 =...

Nick

---

_[View the full topic](https://discourse.nodered.org/t/string-to-number/988)._
