# How to format a number input as Currency in USD

**URL:** https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875
**Category:** How do I?
**Tags:** design
**Created:** [February 18, 2023, 10:34pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875 "2023-02-18T22:34:56Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sebaspindu](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sebaspindu](https://community.weweb.io/u/sebaspindu)
#### Post date: [February 18, 2023, 10:34pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/1 "2023-02-18T22:34:56Z")

</div>

I’m using the input number element want to allow user to see it with USD currency format

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/6/6e3a8f86e2b4c710ae9fc8b14fb38e53204188bb.png)

Also how do you customize the increment amount for the arrows, is to 1 by default but I want to add or decrease by 100  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/231ca37ea72365d19505c5688dfe1d34298d088f.png)

Sebas

---

<div class="post-metadata">

### Author: ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)
#### Post date: [February 27, 2023, 3:02pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/2 "2023-02-27T15:02:29Z")

</div>

Hi @sebaspindu 👋

Re your first question, it is not possible to display a number input as a currency. We would need a new element to do that. It can be done using JS but it’s very difficult and advanced.

Re your second question, it’s not possible at this time but the product team is aware of your request so will take a look and decide if/when it can be added to the roadmap.

---

<div class="post-metadata">

### Author: ![justifi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/justifi/32/2846_2.png) [@justifi](https://community.weweb.io/u/justifi)
#### Post date: [March 1, 2023, 3:16pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/3 "2023-03-01T15:16:25Z")

</div>

+1 for a new element that displays input numbers/currencies more gracefully.

---

<div class="post-metadata">

### Author: ![aurelie](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/aurelie/32/13249_2.png) [@aurelie](https://community.weweb.io/u/aurelie)
#### Post date: [March 9, 2023, 10:36am UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/5 "2023-03-09T10:36:37Z")

</div>

We just the release the step parameter for inputs, so your going 100 by 100 is now possible 🙂

---

<div class="post-metadata">

### Author: ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)
#### Post date: [March 9, 2023, 11:25am UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/6 "2023-03-09T11:25:45Z")

</div>

![CleanShot 2023-03-09 at 12.25.10@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/b6501be12cb8c48d09a95cec0eb233c34e2de66a.png)

---

<div class="post-metadata">

### Author: ![sebaspindu](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sebaspindu](https://community.weweb.io/u/sebaspindu)
#### Post date: [March 9, 2023, 1:56pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/7 "2023-03-09T13:56:17Z")

</div>

Amazing ! trying this out now.

---

<div class="post-metadata">

### Author: ![aeynaud](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/aeynaud/32/2050_2.png) [@aeynaud](https://community.weweb.io/u/aeynaud)
#### Post date: [March 9, 2023, 4:28pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/8 "2023-03-09T16:28:39Z")

</div>

You guys are fast, that’s awesome 🙂

---

<div class="post-metadata">

### Author: ![sebaspindu](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@sebaspindu](https://community.weweb.io/u/sebaspindu)
#### Post date: [March 9, 2023, 9:31pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/9 "2023-03-09T21:31:09Z")

</div>

Hey guys, just tried out it works lke a charm ! My only observation is that you need to set up a Max amount for it to work. So in my case where there is no max value I had to do 100000000000, some people may get confused by this.

Also wanted to to follow up $ currency part of the element wondering if there is any docuemtnation on the javascript work around.

---

<div class="post-metadata">

### Author: ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)
#### Post date: [March 16, 2023, 6:38pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/10 "2023-03-16T18:38:03Z")

</div>

Thanks @sebaspindu, noted!

Nope, we don’t have documentation on this. We’re exploring the possibility of adding formatting options to the current `Number` and `Amount` input elements

---

<div class="post-metadata">

### Author: ![justifi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/justifi/32/2846_2.png) [@justifi](https://community.weweb.io/u/justifi)
#### Post date: [June 19, 2023, 7:33pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/11 "2023-06-19T19:33:16Z")

</div>

Any update on

> adding formatting options to the current `Number` and `Amount` input elements?

---

<div class="post-metadata">

### Author: ![flo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/flo/32/13260_2.png) [@flo](https://community.weweb.io/u/flo)
#### Post date: [June 23, 2023, 6:40pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/12 "2023-06-23T18:40:37Z")

</div>

Hi @justifi,

I just updated the ready-made element available in the add panel here 👇

 ![CleanShot 2023-06-23 at 20.03.43@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/0b03badcb3af3115b872e4cfcc0553950647df7a.png)

Here is how it works, I hope you’ll it:  
 ![CleanShot 2023-06-23 at 20.16.00](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/2298f61bc91943926796f5a667592998e7f66d2d.gif)

Let me describe how it is built, so you can customize it yourself.

First, it comes with a variable called `editing`

 ![CleanShot 2023-06-23 at 20.04.29@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/01dc0cfd968cb2df9615156b2320a48c5ac95b94.jpeg)

This variable is used to conditionally display an element to format the currency and the input to type in the value.

 ![CleanShot 2023-06-23 at 20.05.27@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/2c8cc1969aa47d1414d7152eac5a5f49034c1613.jpeg)

On the container, there are 2 workflows:

 ![CleanShot 2023-06-23 at 20.05.53@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/8aff4810aab39b6c14d528999f4d22547689dcf5.jpeg)

On mouse enter, it hides the number element that format the currency and displays the input:

 ![CleanShot 2023-06-23 at 20.09.35@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/7dfc029e411b13f00dfbe588ed5bc2913806c43d.jpeg)

On mouse leave, it hides the input and displays the number element:

 ![CleanShot 2023-06-23 at 20.10.15@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/bdab655e8761efd9e4f8926ce8b2340233d16dc6.jpeg)

Then the elements have the `display` property bound to the variable. It’s important to use the display property and not the `conditional rendering` property. Otherwise, the number element and the input would reinitialize, and you would lose the values.

 ![CleanShot 2023-06-23 at 20.10.36@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/a36378c3da4ab3740b419fc413ba41cd0b75f294.jpeg)  
 ![CleanShot 2023-06-23 at 20.10.59@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/7a68ba7b96bc793010c6c411fb1f274d3874f4a2.jpeg)

One last thing, the number element is bound to the input value and the currency is bound to the select currency input.

 ![CleanShot 2023-06-23 at 20.35.46@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/2/2d475c21da18ae23b71f9841576dcbfad2514786.png)

You can find the `Number` element here 👇, if you wish to display a formatted currency in another use case

 ![CleanShot 2023-06-23 at 20.36.09@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/3/3ea2c28f487d7ea3271633693e44d4d5331039e9.png)

Tell us if that helps 🙂

---

<div class="post-metadata">

### Author: ![justifi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/justifi/32/2846_2.png) [@justifi](https://community.weweb.io/u/justifi)
#### Post date: [June 23, 2023, 8:11pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/13 "2023-06-23T20:11:46Z")

</div>

!!! that looks like its exactly what I wanted. I will begin replacing the existing currency inputs across my app immediately.

Thank you very much

---

<div class="post-metadata">

### Author: ![ericp](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@ericp](https://community.weweb.io/u/ericp)
#### Post date: [July 25, 2023, 10:11pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/14 "2023-07-25T22:11:31Z")

</div>

For some reason when I add the Amount element, it is not including the Formatted currency and Select Currency companion elements. It only places a Label, Number, and Hint elements nested in a Main element. Is this a bug?

---

<div class="post-metadata">

### Author: ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)
#### Post date: [August 9, 2023, 2:17pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/15 "2023-08-09T14:17:46Z")

</div>

Hi @ericp 👋

It does look like a bug. Let me report it internally and get back to you on this one 🙂

---

<div class="post-metadata">

### Author: ![justifi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/justifi/32/2846_2.png) [@justifi](https://community.weweb.io/u/justifi)
#### Post date: [August 11, 2023, 9:55pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/16 "2023-08-11T21:55:23Z")

</div>

@flo

i spent some time trying to implement this auto-formatting input across several forms on my app, but didn’t have much luck.

dragging the element from the Add panel, I was prompted with the “include variables” toggle. Regardless of the selection, the variables were not included. Similarly, no workflows were attached to the element.

Even though they were missing, your instructions were detailed enough that I tried to replicate the functionality .

I immediately found that a global variable (`editing`) is not an ideal solution for my application - in a form, where you might have a dozen inputs, you must implement a naive solution like juggling `editing1`, `editing2`, `editing3`…`editing_n`, or have to add a second variable that interacts with the element’s `id`…among other possible solutions

In any case, the complexity is significantly higher than the other drag-n-drop elements.

I think that this UI component will be easier to achieve if and when WeWeb introduces scoped variables

---

<div class="post-metadata">

### Author: ![luissh84](https://avatars.discourse-cdn.com/v4/letter/l/b77776/32.png) [@luissh84](https://community.weweb.io/u/luissh84)
#### Post date: [August 12, 2023, 12:28am UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/17 "2023-08-12T00:28:01Z")

</div>

Hi @Joyce, It seems that the bug still persists, have you received any feedback about it?

---

<div class="post-metadata">

### Author: ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)
#### Post date: [August 14, 2023, 12:20pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/18 "2023-08-14T12:20:47Z")

</div>

Hi Luis, the bug is in the queue. Development has not started on it

---

<div class="post-metadata">

### Author: ![luissh84](https://avatars.discourse-cdn.com/v4/letter/l/b77776/32.png) [@luissh84](https://community.weweb.io/u/luissh84)
#### Post date: [August 14, 2023, 4:43pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/19 "2023-08-14T16:43:14Z")

</div>

thanks for the update @Joyce

---

<div class="post-metadata">

### Author: ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)
#### Post date: [August 24, 2023, 9:01am UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/20 "2023-08-24T09:01:41Z")

</div>

Hi @luissh84, @justifi, @ericp 👋

The `Amount` element should be fixed now 🙂

Don’t hesitate to reach out again if you run into other issues.

---

<div class="post-metadata">

### Author: ![ReadyDev](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@ReadyDev](https://community.weweb.io/u/ReadyDev)
#### Post date: [September 13, 2024, 1:51pm UTC](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875/21 "2024-09-13T13:51:52Z")

</div>

I am trying to use this element but I cant find it in the inputs, @Joyce

[Next page](https://community.weweb.io/t/how-to-format-a-number-input-as-currency-in-usd/1875.md?page=2)
