# How to Format Financial Number Input? (Thousand separators and 2 decimal places)

**URL:** https://community.weweb.io/t/how-to-format-financial-number-input-thousand-separators-and-2-decimal-places/12258
**Category:** How do I?
**Created:** [September 12, 2024, 7:37am UTC](https://community.weweb.io/t/how-to-format-financial-number-input-thousand-separators-and-2-decimal-places/12258 "2024-09-12T07:37:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hwgz01](https://avatars.discourse-cdn.com/v4/letter/h/9dc877/32.png) [@hwgz01](https://community.weweb.io/u/hwgz01)
#### Post date: [September 12, 2024, 7:37am UTC](https://community.weweb.io/t/how-to-format-financial-number-input-thousand-separators-and-2-decimal-places/12258/1 "2024-09-12T07:37:07Z")

</div>

Hi Fellow Wewebers

Does anyone know how to format input for Financial Numbers?  
That can display:

1. Thousand separators
2. The maximum two decimal places (if and when there is any decimal value).

I have tried these methods, however had no luck,

**Masked Input**  
Facing issue where the separator “,” would not automatically adjust itself. For example, initially 1,000 but when removing the zero at the end it would display 1,00

**AI copilot**  
It would not stop users from entering more than 2 decimal numbers.

**Suggestions from previous posts**

> [@Input that adds a comma separator when entering a number](https://community.weweb.io/t/input-that-adds-a-comma-separator-when-entering-a-number/5504/8):
>
> Hi @luka if I put a pattern (000,000,000) in masked input pattern it is separating the input but it is doing it from left to right (for ex: 123,45) how do I make it (12,345)?

> [@Thousands separator comma number input](https://community.weweb.io/t/thousands-separator-comma-number-input/6021/9):
>
> Consegui resolver aqui no Brasil, colocar virgula e ponto.

**Including:**  
“Numeral” plugin from NPM, however it is showing

“pluginVariables.69d4a5bb-09a3-4f3d-a94e-667c21c057eb.numeral is not a function”

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/768dda27bf3739dafc629dda06f22ad21a835e95.jpeg)

---

<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: [September 18, 2024, 2:54pm UTC](https://community.weweb.io/t/how-to-format-financial-number-input-thousand-separators-and-2-decimal-places/12258/3 "2024-09-18T14:54:57Z")

</div>

Hi @hwgz01 👋

Would something like this work for you?

 ![CleanShot 2024-09-18 at 16.53.19@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/d8344c78c05c489f302164e79d28a4c28816402b.png)

If yes, here’s the JS code snippet:

```auto
const formatter = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD',
});

return formatter.format(1000);

```

If not, let me know. I’ll try to think of another approach that wouldn’t be too cumbersome.
