간단프로젝또 3일차

jyp·2022년 12월 21일
0

프로젝또

목록 보기
4/13

달력에서 년,월을 바꾸는 코드

top과 bottom에 들어가는 사이에 내용에 높이가 달라지는경우 height(높이)의 값을 지우면
자동으로 위아래를 맞춰줌

if(month==1)
{
<a href="reserve.jsp?year=<%=year-1%>&month=12"></a>
}
else
{
<a href="reserve.jsp?year=<%=year%>&month=<%=month-1%>"></a>
<h3 style="display:inline;"> <%=year%>년 <%=month%>월 </h3>
<%
if(month==12)
{
%>
<a href="reserve.jsp?year=<%=year+1%>&month=<%=month-11%>"></a>
<%
}
else
{
%>
<a href="reserve.jsp?year=<%=year%>&month=<%=month+1%>"></a>
<%
}
%>

숫자에 , 포함해서 사용할때 메소드로 만들어놓고 불러와서 사용하기

public static String comma(int num)
{
	DecimalFormat df=new DecimalFormat("#,###");
	return df.format(num);
}
profile
국비 코딩

0개의 댓글