// Judge A Char is an Ascii Char
function IsAscii(ch)
{
	if(ch > 0 && ch <= 255)
	{
		return true;
	}
	else
	{
		return false;
	}
}

// Get Length Of String By Ascii
function StrLenOfAscii(str)
{
	var str_len;
	str_len = 0;
	for(var i=0;i<str.length;i++)
	{
		if(IsAscii(str.charCodeAt(i)))
		{
			str_len += 1;
		}
		else
		{
			str_len += 2;
		}
	}
	return str_len;
}

// Cut String in Length
function printFmtStr(str,length)
{
	var len,idx;
	len = 0;
	idx = 0;
	if(length>=StrLenOfAscii(str)){
		return str;
	}
	var str_result = "";
	length=length-1;
	while (len < length)
	{
		str_result += str.charAt(idx);
		if(IsAscii(str.charCodeAt(idx)))
		{
			len += 1;
		}
		else
		{
			len += 2;
		}
		idx += 1;
	}
	if(len > length)
	{
		str_result = str_result.substr(0,str_result.length-1);
	}
	
	return str_result+"." ;
}