GithubHelp home page GithubHelp logo

moneyconvertor's Introduction

简介

MoneyConvertor 是专门对人民币进行大小写转换的类,该方法可以完美转换任何形式小写货币格式为人民币大写。

示例

编号 小写货币 大写货币
1 ¥ 1.5 人民币(大写) 壹元伍角
2 ¥ 50000 人民币(大写) 伍万元整
3 ¥ 65001.05 人民币(大写) 陆万伍仟零壹元零伍分
4 ¥ 101010101011.01 人民币(大写) 壹仟零壹拾亿壹仟零壹拾万壹仟零壹拾壹元零壹分
5 ¥ 1,999,999,999 人民币(大写) 壹拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖元整
6 ¥ .5 人民币(大写) 伍角
7 ¥ 1000.00 人民币(大写) 壹仟元整
8 ¥ a.22 人民币(大写) 不是有效的货币数值

使用方式

require __DIR__ . '/MoneyConvertor.php';
$mc = new MoneyConvertor();
//数字类型
echo $mc->convert(1000.00);
//字符串类型
echo $mc->convert('1.322');
//特殊字符串逗号分割类型
echo $mc->convert('100,000,000.00');
//特殊字符串无整数位类型
echo $mc->convert('.5');

moneyconvertor's People

Contributors

hicode avatar

Stargazers

李成斌 avatar gerry avatar guanchaoguo avatar  avatar Bottle avatar CapZhaot avatar  avatar Yu Li avatar Summer avatar Cat avatar  avatar xxd2 avatar zhixing avatar jifei avatar Kaiger avatar Newton avatar iMactool avatar  avatar  avatar 谢瑞卿 avatar 郝波 avatar visvoy avatar Li Zhen Cheng avatar

Watchers

James Cloos avatar  avatar

moneyconvertor's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.