定制 sanmai/japanese-numerals 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sanmai/japanese-numerals

最新稳定版本:v0.1.3

Composer 安装命令:

composer require sanmai/japanese-numerals

包简介

Library to convert Japanese numeral to their Western variants (AKA Hindu-Arabic numerals)

README 文档

README

Build Status Coverage Status Latest Stable Version License

JapaneseNumeral

Library to convert Japanese numeral to their Western variants (AKA Hindu-Arabic numerals)

Installation is simple:

composer require sanmai/japanese-numerals

Usage

To convert a number from Hindu-Arabic numerals to Japanese numerals, use:

$japanese = \JapaneseNumerals\JapaneseNumerals::fromArabicToJapanese(123);
var_dump($japanese);

Should output:

string(12) "百二十三"

To convert a string of Japanese numerals to Hindu-Arabic numerals, use:

$arabic = \JapaneseNumerals\JapaneseNumerals::fromJapaneseToArabic('二千二十五');
var_dump($arabic);

Should output:

string(4) "2025"

Known bugs

This library isn't bug-free. Most notably it fails to interpret 九百八十三万六千七百三 as 9836703 and 二十億三千六百五十二万千八百一 as 2036521801, examples given in the section on large numbers in the Wikipedia article.

Acknowledgements

Special thanks go to Navarr Barnier (@navarr) for the initial implementation of the algorithm.

统计信息

  • 总下载量: 13.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-30