# Invalid token type: number. Expected: Number

**URL:** <https://community.homey.app/t/invalid-token-type-number-expected-number/129611>\
**Category:** Questions & Help\
**Created:** [February 3, 2025, 6:54am UTC](https://community.homey.app/t/invalid-token-type-number-expected-number/129611 "2025-02-03T06:54:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![melectro](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/melectro/32/78999_2.png) [@melectro](https://community.homey.app/u/melectro)\
**Post date:** [February 3, 2025, 6:54am UTC](https://community.homey.app/t/invalid-token-type-number-expected-number/129611/1 "2025-02-03T06:54:05Z")

</div>

I’m trying to get a simple script running, where I want to read an argument and process a numeric value. To start with, I’m just reading the value.

As you can see in the attached image, the test run returns “3”, which is exactly what I expect at this stage. However, I’m getting an error message in the script test:

`{"message":"Invalid token type: number. Expected: Number"}`

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/c/4c2060dcd1d248b9c04b8652fc51d8e2779245be.png)

Additionally, there’s an error from the flow card when my flow runs, causing everything to stop at that point. The error message from the card is as follows:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/f/1f7c81385d75ca31f1f87b9ed9cfe58faa0bf3c5.png)

I can’t figure out what’s wrong. The input value is blue, indicating that it’s a numeric value, so why is it complaining?

Any ideas?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [February 3, 2025, 6:59am UTC](https://community.homey.app/t/invalid-token-type-number-expected-number/129611/2 "2025-02-03T06:59:05Z")

</div>

> [@melectro](#):
>
> the test run returns “3”

The quotes around it mean that it’s a string, not a number. To return a number, use this:

```auto
return Number(test);

```

---

<div class="post-metadata">

**Author:** ![melectro](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/melectro/32/78999_2.png) [@melectro](https://community.homey.app/u/melectro)\
**Post date:** [February 3, 2025, 7:08am UTC](https://community.homey.app/t/invalid-token-type-number-expected-number/129611/3 "2025-02-03T07:08:46Z")

</div>

Thank you !
