Number to Chinese, uppercase, amount

Source: Internet
Author: User

recently, found another kind of digital to Chinese, capitalization, the amount of the method, I think it will be more appropriate than the previous found :NPM installation package address: Https://npm.taobao.org/package/nzh (here, There will be more detailed use of the introduction. And I just measured one of them ... )

Introduction: Nzh is suitable for the development process needs to convert the number to the Chinese scene in the form of a string conversion, solve the problem of large numbers and floating point number, please self-rounding the original data and other operations.

1. First install the dependency package in the project:npm install nzh

2. In fact, this is their own at the time of a small test, using Nzh, after the installation of the dependency package, they will nzh.js file directly into the page,

<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>Title</title>    <Scripttype= "Text/javascript"src= "Js/jquery-1.11.3.js"></Script>    <Scripttype= "Text/javascript"src= "Js/nzh.js"></Script></Head><Body><Divstyle= "margin:100px 200px;">    <P>Enter Amount</P>    <inputtype= "text"ID= "Low"></BR>    <inputtype= "button"value= "Converted to uppercase amount"ID= "BTN"onclick= "trans ()"/>    <DivID= "All"></Div></Div><Scripttype= "Text/javascript">JQuery (function() {JQuery ("#btn"). Click (function () {            vartext=JQuery ("#low"). Val (); varNZHCN=nzh.cn; JQuery ("#all"). HTML (Nzhcn.tomoney (text));    }); });</Script></Body></HTML>

The effect is:

3. I think the method will be better than the previous two methods, but it depends on the specific situation, choose which one to use.

Number to Chinese, uppercase, amount

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.