用java進行人民幣大寫轉換

2021-04-12 16:01:22 字數 603 閱讀 9969

自認為無懈可擊,願高人測試。

受到dracularking的啟發,謹表示謝意,願與大家共享思路。

public class rmbconvert ;

private static string level = new string ;

string result = resultsb.reverse().tostring();

result = result.replaceall("零拾", "零");

result = result.replaceall("零佰", "零");

result = result.replaceall("零仟", "零");

result = result.replaceall("[零]+", "零");

result = result.replaceall("零圓", "圓");   

result = result.replaceall("零萬", "萬");

result = result.replaceall("零億", "億");   

system.out.println(result + "整");

} catch (exception e) }}

人民幣大寫轉換

人民幣大寫轉換 param numbervalue 人民幣小寫 return rmbcapital function numbervalue var chinesevalue 轉換後的漢字金額 var string1 零壹貳叄肆伍陸柒捌玖 漢字數字 var string2 萬仟佰拾億仟佰拾萬仟佰拾元...

pascal 人民幣大寫轉換

我們在程式設計的過程中,特別是開發和財務相關的應用程式的時候,幾乎都會遇到要將阿拉伯數字 一般是貨幣金額 轉換為中文大寫的要求。也有一些轉換程式,但大都不符合財務實際要求,比如最簡單的 function xd xx currency string var dx,ws string i,cd inte...

人民幣數字大寫轉換

中文大寫金額數字應用壹 貳 叄 肆 伍 陸 柒 捌 玖 拾 佰 仟 萬 億 元 角 分 零 整 正 等字樣。中文大寫金額數字到 元 為止的,在 元 之後,應寫 整 或 正 字,在 角 之後,可以不寫 整 或 正 字。中文大寫金額數字前應標明 人民幣 字樣,大寫金額數字有 分 的,分 後面不寫 整 或...