Number

Number fields displays the value as a formatted number. It can be any local currency, decimal or percentage value. Use the Vue i18n function $n under the hood.

<template>
  <va-number-field source="price" format="currency"></va-number-field>
</template>

Creates a number formatted in span:

<span>49,92&nbsp;€</span>

Format

For the targeted i18n locale, you first need to save a valid number format:

src/i18n/rules/numbers.js

export default {
  en: {
    currencyFormat: {
      style: "currency",
      currency: "USD",
    },
  },
  tr: {
    currencyFormat: {
      style: "currency",
      currency: "TL",
    },
  },
};

Check out the documentation for Vue i18n.

Mixins

  • Field
  • Source
  • Resource

Properties

Property Type Description
source string The property of the resource to fetch the value to display. Supports dot display for slot used object.
item null Overrides the default element added by VaShow.
format string The name of the number format to use. Vue i18n must be predefined in your plugin.