# uxcore-formatter

> a formatter library for uxcore

Latest version **0.1.13** (published 2019-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install uxcore-formatter
pnpm add uxcore-formatter
yarn add uxcore-formatter
bun add uxcore-formatter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.13 |
| Published | 2019-05-22 |
| First published | 2015-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | eternalsky |
| Maintainers | eternalsky, ex90rts, howardwong, shanchao, surfacew, taoqili |
| Keywords | react, react-component, uxcore-formatter, Formatter |

## Links

- npm: https://www.npmjs.com/package/uxcore-formatter
- Repository: https://github.com/uxcore/uxcore-formatter
- Homepage: https://github.com/uxcore/uxcore-formatter#readme
- Issues: http://github.com/uxcore/uxcore-formatter/issues
- npm.io page: https://npm.io/package/uxcore-formatter

## Dependencies (1)

- [big.js](https://npm.io/package/big.js.md) ^5.0.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.13 (latest) — 2019-05-22
- 0.1.12 — 2018-07-02
- 0.1.11 — 2018-05-18
- 0.1.10 — 2018-03-26
- 0.1.9 — 2018-03-26
- 0.1.7 — 2017-11-21
- 0.1.6 — 2017-10-16
- 0.1.4 — 2017-01-03
- 0.1.3 — 2016-07-22
- 0.1.2 — 2015-12-29
- 0.1.1 — 2015-12-18
- 0.1.0 — 2015-10-12

## README

---

## uxcore-formatter [![Dependency Status](http://img.shields.io/david/uxcore/uxcore-formatter.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-formatter) [![devDependency Status](http://img.shields.io/david/dev/uxcore/uxcore-formatter.svg?style=flat-square)](https://david-dm.org/uxcore/uxcore-formatter#info=devDependencies) 


Formatter 是一些处理字符串的工具函数的集合，他的设计原则是第一个参数为一个 string，返回值为一个 string，后面的参数皆为可选，即有默认值。

#### setup develop environment

```sh
$ git clone https://github.com/uxcore/uxcore-formatter
$ cd uxcore-formatter
$ npm install
$ npm start
```

## Usage
```
var Formatter = require("uxcore-formatter");
console.log(Formatter.date(new Date(), 'YYYY-MM-DD');
```

## API
> 目前提供的函数包括：

### Date
```javascript
Formatter.date(new Date(), 'YYYY-MM-DD HH:mm:ss'); // 2015-10-12 14:22:16
```

### money

```javascript
Formatter.money("6566456.65466545") // "6 566 456.65466545"
Formatter.money("6566456.65466545", ",")  // "6,566,456.65466545"
Formatter.money("6566456", ",")  // "6,566,456"
Formatter.money("6566456", ",", 4) // "6,566,456.0000"
Formatter.money("6566456", ",", 2) // "6,566,456.00"
Formatter.money("6566456.65466545", ",", 4)  // "6,566,456.6547"
Formatter.money("6566456.65466545", ",", 2) // "6,566,456.65"
```

### cnmobile
```javascript
Formatter.cnmobile('+8615652988282', ' '); // +86 1565 2988 282
```

### card
```javascript
Formatter.card('1565298828212233', ' '); // 1565 2988 2821 2233
```

---
_Source: https://npm.io/package/uxcore-formatter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
