처리된 값 문자열을 반환한다.
Parameters | Type | Description |
---|---|---|
strValue | STRING | 값 |
nRoundType | short | 데이터 처리 방식 (0: 반올림, 1:버림, 2:올림) |
nRoundPos | short | 데이터 처리 위치 (양수면 정수부, 음수면 소수점부) |
Type | Description |
---|---|
STRING | 처리된 값 문자열 |
리턴값은 문자열로 반환된다. 숫자형으로 변환하기 위해서는 자바스크립트 언어 함수인 parseFloat 함수를 사용한다.
내부적으로 strValue 값을 문자열로 변환 후, 숫자/소수점/마이너스 기호를 제외한 문자을 공백 문자로 치환후, 값에 대한 처리를 수행한다.
//
function btn_on_mouseup(objInst)
{
factory.consoleprint("value = " + factory.round(456.456, 0, 0)); //->456
// 정수부 첫번째 자리값 기준 처리
factory.consoleprint("value = " + factory.round(456.456, 0, 1)); //->460
// 정수부 두번째 자리값 기준 처리
factory.consoleprint("value = " + factory.round(456.456, 0, 2)); //->500
// 소수부 첫번째 자리값 기준 처리
factory.consoleprint("value = " + factory.round(456.456, 0, -1)); //->456
// 소수부 두번째 자리값 기준 처리
factory.consoleprint("value = " + factory.round(456.456, 0, -2)); //->456.5
}