Skip to content

vinayakkulkarni/vue-intl-numberformat

Repository files navigation

Vue Intl.NumberFormat

NPM version NPM downloads CircleCI

  • Tiny reusable Vue wrapper for Intl NumberFormat
  • Demo Link: Click Here

  • This is on GitHub so let me know if I've b0rked it somewhere, give me a star ⭐ if you like it 🍻

Install

yarn add vue-intl-numberformat

CDN: UNPKG | jsDelivr

Usage

<template>
  <vue-intl-numberformat locale="en-IN" formatStyle="currency" currency="INR" :number="303041.201"></vue-intl-numberformat>
</template>

<script>
import VueIntlNumberformat from 'vue-intl-numberformat';

export default {
  components: {
    VueIntlNumberformat,
  },
};
</script>

API

Props

Name Type Required? Description
number Number Yes The digit that you want to format.
locale String No A string with a BCP 47 language tag. More Here
formatStyle String No The formatting style to use. Possible values are "decimal" for plain number formatting, "currency" for currency formatting, and "percent" for percent formatting; the default is "decimal".
currency String No The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar etc. More Here
maxDigits Number No The maximum number of significant digits to use. Possible values are from 1 to 21.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

vue-intl-numberformat © Vinayak, Released under the MIT License.
Authored and maintained by Vinayak Kulkarni with help from contributors (list).

vinayak.site · GitHub @vinayakkulkarni · Twitter @_vinayak_k