JS small turn to realize capital, JS digital revolution million

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<title> Lowercase to uppercase </title>
<style type= "Text/css" >
div {position:absolute;left:lin;top:lin;bottom:lin;right:lin; Background-color: #AE57A4; text-align:center;
width:500px;}
</style>
<script type= "Text/javascript" >
function Transformnumber () {
var nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
var chins = ["0", "one", "II", "three", "Restaurant", "WU", "Lu", "Qi", "ba", "JIU");
var money = ["Yuan", "ten", "Hundred", "thousand", "Million", "ten", "Hundred", "thousand", "billion", "", "", "" "];
var money1 = ["Angle", "min"];
var number = document.getElementById ("number"). Value;
var numbers = Number.split (".")
var chin = "";
var chin1 = "";
for (var i = numbers[0].length; i > 0; i--) {
var s = numbers[0].charat (numbers[0].length-i);
Chin + = Chins[s] + money[i-1];
}
if (numbers[1]! = null) {
for (var j = 0; J < Numbers[1].length; J + +) {
var B = Numbers[1].charat (j);
Chin1 + = Chins[b] + money1[j];
}
}
var China = chin + chin1;
document.getElementById ("Newnumber"). Value = China;
}
function Clearnumber () {
document.getElementById ("number"). Value = "";
document.getElementById ("Newnumber"). Value = "";
}
function Promptmessage () {
document.getElementById ("number"). Value = "Retain two decimal places after decimal point";
}
function Clearmessage () {
document.getElementById ("number"). Value = "";
}
Window.onload = Promptmessage;
</script>
<body>
<div><br/><br/>
<span> Please enter the amount you want to convert: </span><input type= "text" id= "number" onfocus= "clearmessage ();" ><br/><br/>
<span> converted uppercase Amount: </span><input type= "text" id= "Newnumber"/><br/><br/>
<input type= "button" id= "Transform" value= "Convert" onclick= "Transformnumber ();"/>
<input type= "button" id= "clear" value= "Clear 0" onclick= "clearnumber ();" >
</div>
</body>

Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

JS small turn to realize capital, JS digital revolution million

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.