java 金額轉大寫

2021-06-19 03:01:42 字數 1171 閱讀 2068

/**

* @classname: numberconvert

* @description: todo

* @author pangtt

* @date 2012-8-22 上午9:08:10

*/public class moneyutil ;

/** 整數部分的單位 */

private static final string iunit = ;

/** 小數部分的單位 */

private static final string dunit = ;

/*** 得到大寫金額。10,001,000.09

*/public static string tochinese(string str) else if (str.indexof(".") == 0) else

// integerstr去掉首0,不必去掉decimalstr的尾0(超出部分捨去)

if (!integerstr.equals(""))

}// overflow超出處理能力,直接返回

if (integerstr.length() > iunit.length)

int integers = toarray(integerstr);// 整數部分數字

boolean ismust5 = ismust5(integerstr);// 設定萬單位

int decimals = toarray(decimalstr);// 小數部分數字

return getchineseinteger(integers, ismust5) + getchinesedecimal(decimals);

}/**

* 整數部分和小數部分轉換為陣列,從高位至低位

*/private static int toarray(string number)

return array;

}/**

* 判斷第5位數字的單位"萬"是否應加。

*/private static boolean ismust5(string integerstr) else

return integer.parseint(subinteger) > 0;

} else

}public static void main(string args)

}

java 金額轉中文大寫

public class chinanumber private static string chs number 傳入數字金額字串,返回數字金額對應的中文大字與讀法 param money 金額字串 return 金額中文大寫 public static string getchsnumber s...

金額小寫轉大寫

create procedure dbo trannumbertobigfordecrypt n lowermoney numeric 15,2 v transtype int,ret varchar 200 output with encryption as descript 解密exec sp ...

金額小寫轉大寫

create procedure dbo trannumbertobigfordecrypt n lowermoney numeric 15,2 v transtype int,ret varchar 200 output with encryption as descript 解密exec sp ...