Topic: Currency Format in Input Form

BeldenSpartan premium asked 2 years ago

I have input form with type="number". When the user enters the number, I'd like it formatted to a currency (specifically, US dollars). How can I do this?

<div class="form-outline">
    <input type="number" id="typeNumber" class="form-control" value={{ StartPrice }} />
    <label class="form-label" for="typeNumber">Set Target Price</label>

Additionally, is there a way to change the background color of the input field? Thank you -

Dawid Wajszczuk staff answered 2 years ago


I'm not sure if you wanted this kind of formatting, but you can use something like this It can be only achieved with text input.

As for changing the background you can do it with simple bg-* class, for example bg-primary. Here is the snippet showing more customization of the input field

Keep coding,

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.9.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No