-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb3beea
commit d580ef8
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Vue Intl.NumberFormat | ||
|
||
[](https://npmjs.com/package/vue-intl-numberformat) [](https://npmjs.com/package/vue-intl-numberformat) [](https://travis-ci.org/vinayakkulkarni/vue-intl-numberformat) | ||
|
||
* Tiny reusable Vue wrapper for Intl NumberFormat | ||
|
||
- This is [on GitHub](https://github.com/vinayakkulkarni/vue-intl-numberformat) so let me know if I've b0rked it somewhere, give me a star :star: if you like it :beers: | ||
|
||
## Install | ||
|
||
```bash | ||
yarn add vue-intl-numberformat | ||
``` | ||
|
||
CDN: [UNPKG](https://unpkg.com/vue-intl-numberformat/dist/) | [jsDelivr](https://cdn.jsdelivr.net/npm/vue-intl-numberformat/dist/) | ||
|
||
## Usage | ||
|
||
```vue | ||
<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](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation) | | ||
| `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](http://www.currency-iso.org/en/home/tables/table-a1.html) | | ||
| `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](https://github.com/vinayakkulkarni), Released under the [MIT](./LICENSE) License.<br> | ||
Authored and maintained by Vinayak Kulkarni with help from contributors ([list](https://github.com/vinayakkulkarni/vue-intl-numberformat/contributors)). | ||
|
||
> [vinayak.site](https://vinayak.site) · GitHub [@vinayakkulkarni](https://github.com/vinayakkulkarni) · Twitter [@\_vinayak_k](https://twitter.com/_vinayak_k) |