人民幣小寫轉換為大寫

2021-06-02 23:54:22 字數 906 閱讀 8433

本程式的作用是將人民幣的小寫形式轉換為大寫,例如:呼叫upper("18.5"),將會返回字串「壹拾捌圓伍角」。

package com.zzb.test0;  

import junit.framework.assert;  

import org.junit.test;  

/*** 測試人民幣小寫轉大寫

* @author zhengzhb

*/public

class uppermoney   

string part= money.split("\\.");  

stringbuffer integer = new stringbuffer();  

for(int i=0;i0].length();i++)  

stringbuffer decimal = new stringbuffer();  

if(part.length>1 && !"00".equals(part[1]))  

}  string result = integer.tostring()+decimal.tostring();  

return

this.dispose(result);  

}  private

char uppernumber(char number)  

return

0;  

}  private

char uppernumber(int index)  

return

0;  

}  private string dispose(string result)  

@test

public

void test() catch (exception e)   

}  } 

ASP 人民幣小寫轉換為大寫

人民幣小寫轉換為大寫 人民幣大小寫轉換格式 dim str 9 str 0 零 str 1 壹 str 2 貳 str 3 叄 str 4 肆 str 5 伍 str 6 陸 str 7 柒 str 8 捌 str 9 玖 aa request.form source hh formatnumber...

人民幣小寫金額轉換為大寫函式

程式 function money thenumber dim money,i,string1,string2,length,checkp 定義變數 dim one onestr 定義陣列 string1 零壹貳叄肆伍陸柒捌玖 string2 萬仟佰拾億仟佰拾萬仟佰拾元角分釐毫 checkp ins...

人民幣小寫金額轉換為大寫函式

程式 functionmoney thenumber dimmoney,i,string1,string2,length,checkp 定義變數 dimone onestr 定義陣列 string1 零壹貳叄肆伍陸柒捌玖 string2 萬仟佰拾億仟佰拾萬仟佰拾元角分釐毫 checkp instr ...