|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkr.co.hit.live.util.NumericHelper
public class NumericHelper
Number(Numeric) 관련 Live Framework의 Helper Class
아래 Method들은 모두 static으로 선언 되었기 때문에 유념하기 바란다.
| Field Summary | |
|---|---|
static int |
ROUND_CEILING
무조건 올림 (음수일 경우에 무조건 내림) |
static int |
ROUND_DOWN
내림(절사) |
static int |
ROUND_FLOOR
무조건 내림 (음수일 경우에 무조건 올림) |
static int |
ROUND_HALF_UP
반올림 |
static int |
ROUND_UNNECESSARY
사용하지 않음 |
static int |
ROUND_UP
올림 |
| Constructor Summary | |
|---|---|
protected |
NumericHelper()
NumericHelper의 default 컨스트럭터(Constructor). |
| Method Summary | |
|---|---|
static String |
add(String val1,
String val2)
덧셈을 실행하여 문자열로 리턴한다. |
static String |
add(String val1,
String val2,
int scale)
덧셈을 실행하여 문자열로 리턴한다. |
static String |
add(String val1,
String val2,
int scale,
int roundMode)
덧셈을 실행하여 문자열로 리턴한다. |
static String |
divide(String val1,
String val2,
int roundMode)
val1 / val2 결과를 문자열로 리턴한다. |
static String |
divide(String val1,
String val2,
int scale,
int roundMode)
val1 / val2 결과를 문자열로 리턴한다. |
static String |
isDivide(String thisVal,
String addVal,
int roundMode)
Deprecated. Use divide Method. |
static String |
isDivide(String thisVal,
String addVal,
int scale,
int roundMode)
Deprecated. Use divide Method. |
static String |
isMinus(String thisVal,
String addVal)
Deprecated. Use subtract Method. |
static String |
isMinus(String thisVal,
String addVal,
int scale)
Deprecated. Use subtract Method. |
static String |
isMinus(String thisVal,
String addVal,
int scale,
int roundMode)
Deprecated. Use subtract Method. |
static String |
isMultiply(String thisVal,
String addVal)
Deprecated. Use multiply Method. |
static String |
isMultiply(String thisVal,
String addVal,
int scale)
Deprecated. Use multiply Method. |
static String |
isMultiply(String thisVal,
String addVal,
int scale,
int roundMode)
Deprecated. Use multiply Method. |
static boolean |
isNumber(String source)
문자열의 Number형 문자열인지 여부 (- 기호나 소수점도 포함) |
static boolean |
isNumeric(String str)
숫자형 문자열인지 확인한다. |
static String |
isPlus(String thisVal,
String addVal)
Deprecated. Use add Method. |
static String |
isPlus(String thisVal,
String addVal,
int scale)
Deprecated. Use add Method. |
static String |
isPlus(String thisVal,
String addVal,
int scale,
int roundMode)
Deprecated. Use add Method. |
static String |
multiply(String val1,
String val2)
곱셈을 실행하여 결과를 문자열로 리턴한다. |
static String |
multiply(String val1,
String val2,
int scale)
곱셈을 실행하여 결과를 문자열로 리턴한다. |
static String |
multiply(String val1,
String val2,
int scale,
int roundMode)
곱셈을 실행하여 결과를 문자열로 리턴한다. |
static BigDecimal |
round(BigDecimal rounder,
int scale,
int roundMode)
숫자형 자료의 round 함수. |
static double |
round(double rounder,
int scale,
int roundMode)
숫자형 자료의 round 함수. |
static long |
round(long rounder,
int scale,
int roundMode)
숫자형 자료의 round 함수. |
static String |
round(String rounder,
int scale,
int roundMode)
숫자형 자료의 round 함수. |
static String |
setScale(String thisVal,
int scale,
int roundMode)
기본값을 scale 자릿수만큼 ROUND한다. |
static String |
subtract(String val1,
String val2)
기본뺄셈을 실행하여 결과를 문자열로 리턴한다. |
static String |
subtract(String val1,
String val2,
int scale)
기본뺄셈을 실행하여 결과를 문자열로 리턴한다. |
static String |
subtract(String val1,
String val2,
int scale,
int roundMode)
기본뺄셈을 실행하여 결과를 문자열로 리턴한다. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ROUND_UP
올림
public static final int ROUND_DOWN
내림(절사)
public static final int ROUND_HALF_UP
반올림
public static final int ROUND_FLOOR
무조건 내림 (음수일 경우에 무조건 올림)
public static final int ROUND_CEILING
무조건 올림 (음수일 경우에 무조건 내림)
public static final int ROUND_UNNECESSARY
사용하지 않음
| Constructor Detail |
|---|
protected NumericHelper()
NumericHelper의 default 컨스트럭터(Constructor).
| Method Detail |
|---|
public static boolean isNumber(String source)
문자열의 Number형 문자열인지 여부 (- 기호나 소수점도 포함)
source - 검증 하고자 하는 문자열
public static String add(String val1,
String val2)
덧셈을 실행하여 문자열로 리턴한다.
val1 - Stringval2 - String
add(String, String, int),
add(String, String, int, int)
public static String add(String val1,
String val2,
int scale)
덧셈을 실행하여 문자열로 리턴한다.
덧셈한 결과값의 자릿수를 scale로 지정한다.
val1 - Stringval2 - Stringscale - int 자리수지정
add(String, String, int, int),
add(String, String)
public static String add(String val1,
String val2,
int scale,
int roundMode)
덧셈을 실행하여 문자열로 리턴한다.
덧셈한 결과값의 자릿수를 scale로 지정한다.
덧셈한 결과값의 자릿수와 올림,내림,절삭여부를 roundMode로 지정한다.
val1 - Stringval2 - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
add(String, String, int),
add(String, String)
public static String subtract(String val1,
String val2)
기본뺄셈을 실행하여 결과를 문자열로 리턴한다.
val1 - Stringval2 - String
subtract(String, String, int),
subtract(String, String, int, int)
public static String subtract(String val1,
String val2,
int scale)
기본뺄셈을 실행하여 결과를 문자열로 리턴한다.
뺄셈한 결과값의 자릿수를 scale로 지정한다.
val1 - Stringval2 - Stringscale - int 자리수지정
subtract(String, String, int, int),
subtract(String, String)
public static String subtract(String val1,
String val2,
int scale,
int roundMode)
기본뺄셈을 실행하여 결과를 문자열로 리턴한다.
뺄셈한 결과값의 자릿수를 scale로 지정한다.
뺄셈한 결과값의 자릿수와 올림,내림,절삭여부를 roundMode로 지정한다.
val1 - Stringval2 - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
subtract(String, String, int),
subtract(String, String)
public static String multiply(String val1,
String val2)
곱셈을 실행하여 결과를 문자열로 리턴한다.
val1 - Stringval2 - String
multiply(String, String, int),
multiply(String, String, int, int)
public static String multiply(String val1,
String val2,
int scale)
곱셈을 실행하여 결과를 문자열로 리턴한다.
곱셈한 결과값의 자릿수를 scale로 지정한다.
val1 - Stringval2 - Stringscale - int 자리수지정
multiply(String, String, int, int),
multiply(String, String)
public static String multiply(String val1,
String val2,
int scale,
int roundMode)
곱셈을 실행하여 결과를 문자열로 리턴한다.
곱셈한 결과값의 자릿수를 scale로 지정한다.
곱셈한 결과값의 자릿수와 올림,내림,절삭여부를 roundMode로 지정한다.
val1 - Stringval2 - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
multiply(String, String, int),
multiply(String, String)
public static String divide(String val1,
String val2,
int roundMode)
val1 / val2 결과를 문자열로 리턴한다.
val1 - Stringval2 - StringroundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
divide(String, String, int, int)
public static String divide(String val1,
String val2,
int scale,
int roundMode)
val1 / val2 결과를 문자열로 리턴한다.
계산 결과의 스케일을 scale로 지정한다.
val1 - Stringval2 - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
divide(String, String, int)
public static String setScale(String thisVal,
int scale,
int roundMode)
기본값을 scale 자릿수만큼 ROUND한다.
thisVal - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
@Deprecated
public static String isPlus(String thisVal,
String addVal)
String형 값의 기본덧셈을 실행한다.
thisVal - StringaddVal - String
isPlus(String, String, int),
isPlus(String, String, int, int)
@Deprecated
public static String isPlus(String thisVal,
String addVal,
int scale)
덧셈한 결과값의 자릿수만 지정한다.
thisVal - StringaddVal - Stringscale - int 자리수지정
isPlus(String, String, int, int),
isPlus(String, String)
@Deprecated
public static String isPlus(String thisVal,
String addVal,
int scale,
int roundMode)
덧셈한 결과값의 자릿수와 올림,내림,절삭여부 지정한다.
thisVal - StringaddVal - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
isPlus(String, String, int),
isPlus(String, String)
@Deprecated
public static String isMultiply(String thisVal,
String addVal)
기본곱셈을 실행한다.
thisVal - StringaddVal - String
isMultiply(String, String, int),
isMultiply(String, String, int, int)
@Deprecated
public static String isMultiply(String thisVal,
String addVal,
int scale)
곱셈한 결과값의 자릿수만 지정한다.
thisVal - StringaddVal - Stringscale - int 자리수지정
isMultiply(String, String, int, int),
isMultiply(String, String)
@Deprecated
public static String isMultiply(String thisVal,
String addVal,
int scale,
int roundMode)
곱셈한 결과값의 자릿수와 올림,내림,절삭여부 지정한다.
thisVal - StringaddVal - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
isMultiply(String, String, int),
isMultiply(String, String)
@Deprecated
public static String isDivide(String thisVal,
String addVal,
int roundMode)
나눗셈의 결과값이 정수
thisVal - StringaddVal - StringroundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
isDivide(String, String, int, int)
@Deprecated
public static String isDivide(String thisVal,
String addVal,
int scale,
int roundMode)
나눗셈 결과값의 자릿수와 올림,내림,절삭여부 지정한다
thisVal - StringaddVal - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
isDivide(String, String, int)
@Deprecated
public static String isMinus(String thisVal,
String addVal)
기본뺄셈을 실행한다.
thisVal - StringaddVal - String
isMinus(String, String, int),
isMinus(String, String, int, int)
@Deprecated
public static String isMinus(String thisVal,
String addVal,
int scale)
뺄셈한 결과값의 자릿수만 지정한다.
thisVal - StringaddVal - Stringscale - int 자리수지정
isMinus(String, String, int, int),
isMinus(String, String)
@Deprecated
public static String isMinus(String thisVal,
String addVal,
int scale,
int roundMode)
뺄셈한 결과값의 자릿수와 올림,내림,절삭여부 지정한다.
thisVal - StringaddVal - Stringscale - int 자리수지정roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
isMinus(String, String, int),
isMinus(String, String)
public static BigDecimal round(BigDecimal rounder,
int scale,
int roundMode)
숫자형 자료의 round 함수.
BigDecimal rounder = new BigDecimal(230045.456); int scale = 2; int roundMode = NumericHelper.ROUND_DOWN; BigDecimal result = NumericHelper.round(rounder, scale, roundMode);
result는 "230045.45" 을 가지게 된다.
rounder - 대상 BigDecimal형 Datascale - 자리 올림, 내림이나 반올림 할 자리수를 지정한다.
roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
public static double round(double rounder,
int scale,
int roundMode)
숫자형 자료의 round 함수.
double rounder = 230045.456; int scale = 2; int roundMode = NumericHelper.ROUND_DOWN; double result = NumericHelper.round(rounder, scale, roundMode);
result는 230045.45 을 가지게 된다.
rounder - 대상 double형 Datascale - 자리 올림, 내림이나 반올림 할 자리수를 지정한다.
roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
public static String round(String rounder,
int scale,
int roundMode)
숫자형 자료의 round 함수.
String rounder = "230045.456"; int scale = 2; int roundMode = NumericHelper.ROUND_DOWN; String result = NumericHelper.round(rounder, scale, roundMode);
result는 "230045.45" 을 가지게 된다.
rounder - 대상 String형 Datascale - 자리 올림, 내림이나 반올림 할 자리수를 지정한다.
roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
public static long round(long rounder,
int scale,
int roundMode)
숫자형 자료의 round 함수.
long rounder = 230045; int scale = -1; int roundMode = NumericHelper.ROUND_DOWN; long result = NumericHelper.round(rounder, scale, roundMode);
result는 230040 을 가지게 된다.
rounder - 대상 long형 Datascale - 자리 올림, 내림이나 반올림 할 자리수를 지정한다.
roundMode - int Round 여부
ROUND_UP
ROUND_DOWN
ROUND_HALF_UP
public static boolean isNumeric(String str)
str -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||