Format number on q-input

  • I have a q-input bound to the v-model.
    The value in model is 12345.6
    I need to show it like : 12.345,60
    But the value in model must continue to be numeric … 12345.6
    Is it possible to format number just for display ?
    My q-input :
    <q-input type=“number” class=“q-pl-sm” dense label=“Total” v-model=“valor” input-class=“text-right text-bold”></q-input>


  • sorry for ask it again, but I think that’s a common situation on countries that use comma as decimal point.
    Somebody has a trick for that ?


  • @Pedro use v-money or search for a regular expression for formatting your input under your country’s locale.

  • I quit trying to use v-money. Tried to install it but get lots of dependencies warnings. Maybe I had something wrong in my project because after trying to upgrade all installed modules to the latest versions the project was not compiling any more.
    Had to make a new project and copy the old src files.


Log in to reply