Last active
August 29, 2015 14:13
-
-
Save JiaFeiX/1b45fd3f7b411488838e to your computer and use it in GitHub Desktop.
JS将数字转换为中文大写
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="javascript"> | |
function zhouji(str){ | |
return str.replace(/\d/g,function(m){return arr[m];}) | |
} | |
arr=new Array("日","一","二","三","四","五","六","七","八","九"); | |
</script> | |
<script language="javascript"> | |
document.write(zhouji('1380')); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment