# zhf.str-get-num

> 从字符串中提取出数字部分

Latest version **1.0.0** (published 2018-05-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install zhf.str-get-num
pnpm add zhf.str-get-num
yarn add zhf.str-get-num
bun add zhf.str-get-num
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-05-19 |
| First published | 2018-05-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | zhouhuafei |

## Links

- npm: https://www.npmjs.com/package/zhf.str-get-num
- Repository: https://github.com/zhouhuafei/zhf.str-get-num
- Homepage: https://github.com/zhouhuafei/zhf.str-get-num#readme
- Issues: https://github.com/zhouhuafei/zhf.str-get-num/issues
- npm.io page: https://npm.io/package/zhf.str-get-num

## Recent versions

- 1.0.0 (latest) — 2018-05-19

## README

# 从字符串中提取出数字部分
```
const strGetNum = require('zhf.str-get-num');

strGetNum(); // ''
strGetNum(''); // ''
strGetNum('    '); // ''
strGetNum('从字符串中提取出数字部分'); // ''
strGetNum(0); // '0'
strGetNum(-0); // '0'
strGetNum('-0'); // '0'
strGetNum(1); // '1'
strGetNum(-1); // '-1'
strGetNum('10.2'); // '10.2'
strGetNum('-10.2'); // '-10.2'
strGetNum('-0010.2'); // '-10.2'
strGetNum('-0.010.2'); // '-0.010'
strGetNum('从字符串中提取出数1字部分'); // '1'
strGetNum('-从字符串中提取出数1字部分'); // '-1'
strGetNum('从字符串中提取出数1字部1分'); // '1.1'
strGetNum('-从字符串中提取出数1字部1分'); // '-1.1'
strGetNum('-从字符串中.提取出数1字部1分'); // '-0.1'
strGetNum('.-.0...0.1.0...2.'); // '0.0'
strGetNum('-.0...0.1.0...2.'); // '0.0'
strGetNum('-.1.1..0.1.0...2.'); // '-0.1'
strGetNum('-00.00000000'); // '0.00000000'
strGetNum('-00.00000001'); // '-0.00000001'
strGetNum('-190.'); // '-190'
strGetNum('190.'); // '190'
strGetNum('.190'); // '0.190'
strGetNum('-.190'); // '-0.190'
strGetNum('.1'); // '0.1'
strGetNum('.2'); // '0.2'
strGetNum('.3'); // '0.3'
strGetNum('-.1'); // '-0.1'
strGetNum('-.2'); // '-0.2'
strGetNum('-.3'); // '-0.3'
strGetNum('-......3'); // '-0.3'
```

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