# Unexpected Switch behavior (datatype?)

**URL:** https://discourse.nodered.org/t/unexpected-switch-behavior-datatype/59030
**Category:** General
**Created:** [26 February 2022 16:47 UTC](https://discourse.nodered.org/t/unexpected-switch-behavior-datatype/59030 "2022-02-26T16:47:27Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [26 February 2022 17:10 UTC](https://discourse.nodered.org/t/unexpected-switch-behavior-datatype/59030/2 "2022-02-26T17:10:35Z")

</div>

When posting flows, code etc, in order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

However, if you think a Switch node is not performing as you want, all you need to do is show us what the input to the switch looks like (in a debug node) and show us how you have configured the Switch. Posting a massive flow with mutliple non-core nodes that most do not have installed is just going to put people off.

A common reason that a Switch node does not do as expected is that the value being tested is a string containing a number, not a number. If it is that then you will see it in the debug output.

---

_[View the full topic](https://discourse.nodered.org/t/unexpected-switch-behavior-datatype/59030)._
