0.6.7 • Published 10 years ago

zhutil v0.6.7

Weekly downloads
47
License
-
Repository
github
Last release
10 years ago

npm-zhutil

Utils to handle Chinese, e.g. convert Chinese number to decimal.

Example

zhutil.parseZHNumber('陸佰捌拾玖') === 689

zhutil.annotate(10987654321) === '109億8765萬4321'

zhutil.approximate(10987654321, {base: '億'}) === '109億'
zhutil.approximate(987654321, {base: '億'}) === '9.8億'
zhutil.approximate(10987654321, {base: '億', extra_decimal: 2}) === '9.87億'
zhutil.approximate(987654321, {base: '億', smart: false}) === '9億'

See test/zhutil_test.ls for more example.

Build

$ npm run build

Release

$ node_modules/.bin/gulp --require LiveScript build && git add -u build/ && ...
$ npm version X.Y.Z
$ (update package.ls ...)
$ npm publish
$ git commit; git push; git push --tags
0.6.7

10 years ago

0.6.5

10 years ago

0.6.4

10 years ago

0.6.3

10 years ago

0.6.1

10 years ago

0.6.0

10 years ago

0.5.4

11 years ago

0.5.3

11 years ago

0.5.2

11 years ago

0.5.1

11 years ago

0.5.0

11 years ago