# Replace Number

**URL:** <https://community.n8n.io/t/replace-number/5921>\
**Category:** Questions\
**Tags:** data-transformation, transform-string\
**Created:** [May 23, 2021, 1:06am UTC](https://community.n8n.io/t/replace-number/5921 "2021-05-23T01:06:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsoldado](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/lsoldado/32/4868_2.png) [@lsoldado](https://community.n8n.io/u/lsoldado)\
**Post date:** [May 23, 2021, 1:06am UTC](https://community.n8n.io/t/replace-number/5921/1 "2021-05-23T01:06:26Z")

</div>

I´m trying to replace “.” to “,” in a number.

[  
{  
“cart”: 30707 ,  
“basicAmount”: 14.5 ,  
“Id”: “b57”  
}  
]

Is this possible, i use replace function but it only replace string.

How can i change from 14.5 to 14,5?

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [May 23, 2021, 2:56am UTC](https://community.n8n.io/t/replace-number/5921/2 "2021-05-23T02:56:29Z")

</div>

Welcome to the community @lsoldado !

Numbers do neither have dots nor commas. It is simply how the browser/n8n displays it. So it is impossible to replace them in an actual number.

What you can do, is to convert the number to a string (text) and then replace it there. The expression would look like this:

```javascript
{{$json.basicAmount.toString().replace('.', ',')}}

```

But be aware that as soon as it is a string, you can not use it for any calculations anymore.

Here an example workflow:

---

<div class="post-metadata">

**Author:** ![lsoldado](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/lsoldado/32/4868_2.png) [@lsoldado](https://community.n8n.io/u/lsoldado)\
**Post date:** [May 23, 2021, 3:18am UTC](https://community.n8n.io/t/replace-number/5921/3 "2021-05-23T03:18:15Z")

</div>

Thanks @jan, it works 🙂

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [May 23, 2021, 3:55am UTC](https://community.n8n.io/t/replace-number/5921/4 "2021-05-23T03:55:20Z")

</div>

Glad to hear! Have fun!

---

<div class="post-metadata">

**Author:** ![tray\_corp](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/tray_corp/32/19417_2.png) [@tray\_corp](https://community.n8n.io/u/tray_corp)\
**Post date:** [December 5, 2022, 1:09pm UTC](https://community.n8n.io/t/replace-number/5921/5 "2022-12-05T13:09:41Z")

</div>

@jan

## Workflow could not be activated:

_Workflow ID 22 cannot be saved because it was changed by another user._

I have this error

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [December 6, 2022, 11:58am UTC](https://community.n8n.io/t/replace-number/5921/6 "2022-12-06T11:58:01Z")

</div>

Hi @tray_corp, it seems your question is unrelated to the topic you have posted it on. Perhaps you can open a new thread and share the additional information requested in the question template?

Make sure to post in English so other users can understand your question and help.

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [December 6, 2022, 11:58am UTC](https://community.n8n.io/t/replace-number/5921/7 "2022-12-06T11:58:27Z")

</div>

Closed on December 6, 2022, 11:58am UTC


