1

I have a simple vue component which has has an input and the related v-model. What we want is to format/mask the value, the input should have the german number format (, and . switched (From 1,000,000.00 to 1.000.000,00). The (raw) value inside the component on the other side should have the raw (englisch format) value 1,000,000.00.

Or short: I need an input which shows the german number format, the raw value still should have the english format.

Thanks in advance

I already tried it with maska which shows the value correctly on the frontend, but the raw value is just an int instead of a float.

I also tried to use vue-number-format, but i always get Vue is not defined in the console.

I also searched on stackoverflow and found a few (older) workarounds with the focus and blur event, but this seems like a dirty implementation for me.

coddust
  • 21
  • 1
  • Check if this is helpful to you: https://stackoverflow.com/questions/44538110/how-to-format-numbers-in-vuejs – Zgjim Dida Jan 23 '23 at 15:14
  • 1
    I don't think that helps, a few answers are filters which are removed in vue 3. The other solutions are one way formatting, which is quite easy, but i need the formatting from english format -> german format (for the input) -> back to englisch format for the api. – coddust Jan 24 '23 at 08:17
  • try this formatter: https://igortrinidad.github.io/vue-number-format/ – sarkiroka Jul 29 '23 at 20:27

0 Answers0