驗證不超過兩位小數的金額

	/**
	 * 驗證不超過兩位小數的金額
	 */
	public static boolean checkDoubleStr(String doubleStr){
		try
		{
			String regex = "^(([1-9][0-9]*)|(([0]\\.\\d{1,2}|[1-9][0-9]*\\.\\d{1,2})))$";
			return SystemUtil.match(regex,doubleStr);
		}
		catch (Exception e)
		{
			return false;
		}
	}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章