java將金額轉換為大寫中文

2021-08-20 13:17:03 字數 596 閱讀 4643

public class numberutil ;  

private static final string num = ;

/**

* 將金額小數轉換成中文大寫金額

* @param money

* @return result

*/

public static string test2(double money)

}else

result = result + num[integer.parseint(string.valueof(num))] + unit[unitindex];

} }

//不是角分結尾就加"整"字

if (!result.endswith("角")&&!result.endswith("分"))

//例如沒有這行**,數值"400000001101.2",輸出就是"肆千億萬壹千壹佰零壹元貳角"

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

return result;

}}

將數值金額轉換為中文大寫金額

將數值金額轉換為中文大寫金額 param amount float 金額 支援到分 param type int 補整型別,0 到角補整 1 到元補整 return mixed 中文大寫金額 function convertamounttocn amount,type 1 金額為0,則直接輸出 零元...

金額轉換為中文大寫

轉換數字金額主函式 包括小數 數字字串 轉換成中文大寫後的字串或者出錯資訊提示字串 轉換數字金額主函式 包括小數 public static string convertsum string str 判斷是否是正數字字串 判斷字串 如果是數字,返回true,否則返回false private sta...

AnglurJS將金額轉換為大寫金額

class font small style div 後台 scope.milestone.winbiddate new date 前台就會顯示出這種效果來 根據相同的原理我做了乙個阿拉伯數字轉換大寫數字的過濾convertcurrencyfilter 過濾的 如下 validate input s...