Skip to content

Instantly share code, notes, and snippets.

@JiaFeiX
Last active August 29, 2015 14:13
Show Gist options
  • Save JiaFeiX/1b45fd3f7b411488838e to your computer and use it in GitHub Desktop.
Save JiaFeiX/1b45fd3f7b411488838e to your computer and use it in GitHub Desktop.
JS将数字转换为中文大写
<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