# Math Function in N8N

**URL:** <https://community.n8n.io/t/math-function-in-n8n/12593>\
**Category:** Questions\
**Tags:** expressions, javascript\
**Created:** [March 27, 2022, 3:12am UTC](https://community.n8n.io/t/math-function-in-n8n/12593 "2022-03-27T03:12:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandan988](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@chandan988](https://community.n8n.io/u/chandan988)\
**Post date:** [March 27, 2022, 3:12am UTC](https://community.n8n.io/t/math-function-in-n8n/12593/1 "2022-03-27T03:12:06Z")

</div>

to perform math function like  
+91 9xxxxx is number we want to remove White Space between +91 and 9xxxxxx ,how this can be done and if we want to remove + only or if we want to count the character 10 from left or right and give the output is their any documentation

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [March 27, 2022, 5:58am UTC](https://community.n8n.io/t/math-function-in-n8n/12593/2 "2022-03-27T05:58:21Z")

</div>

Hey @chandan988,

What about just using `.replace(' ', '')` on the end of the variable that will replace the space with nothing.

You can swap the space for a + if you wanted to remove that from the number. To only get the last 10 characters you use use `.slice(-10)`.

Replace: [JavaScript String replace() Method](https://www.w3schools.com/jsref/jsref_replace.asp)  
Slice: [JavaScript String slice() Method](https://www.w3schools.com/jsref/jsref_slice_string.asp)

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [November 6, 2023, 10:12am UTC](https://community.n8n.io/t/math-function-in-n8n/12593/4 "2023-11-06T10:12:43Z")

</div>

Closed on November 6, 2023, 10:12am UTC


