안드로이드 개발 질문/답변
(글 수 45,052)
int len = list.size();
for(int a=0; a<len-1; a++){
String sOpen = list.get(a).get("bidopen_price").toString();
String sHigh = list.get(a).get("bidhigh_price").toString();
String sLow = list.get(a).get("bidlow_price").toString();
String sClose = list.get(a).get("bidclose_price").toString();
// String[] sOpen = list.get(a).get("bidopen_price").toString().split("\\.");
// String[] sHigh = list.get(a).get("bidhigh_price").toString().split("\\.");
// String[] sLow = list.get(a).get("bidlow_price").toString().split("\\.");
// String[] sClose = list.get(a).get("bidclose_price").toString().split("\\.");
float open = Float.valueOf(sOpen);
int nOpen = (int)(open * 100000);
float high = Float.valueOf(sHigh);
int nHigh = (int)(high * 100000);
float low = Float.valueOf(sLow);
int nLow = (int)(low * 100000);
float close = Float.valueOf(sClose);
int nClose = (int)(close * 100000);
파일을 읽어와서
+-----------+---------+------------+----------------+---------------+---------------+--------------+----------------+-----------------+-----------------+----------------+------------------+-----------------+----------------+
| Member_No | shcode | trade_type | data_time | bidopen_price | bidhigh_price | bidlow_price | bidclose_price | offeropen_price | offerhigh_price | offerlow_price | offerclose_price | Selldeal_volume | Buydeal_volume |
+-----------+---------+------------+----------------+---------------+---------------+--------------+----------------+-----------------+-----------------+----------------+------------------+-----------------+----------------+
| 000 | EUR/JPY | 00 | 20100719080000 | 111.65900 | 111.66700 | 111.63700 | 111.64900 | 111.61900 | 111.62800 | 111.60300 | 111.61200 | 0 | 0 |
텍스트파일이 이렇게 있는데 이 파일을 open, high,low,close 이렇게 뽑아왔습니다. 이데이터를가지고 차트를 그릴건데..실데이터가 소수점으로 나오기때문에 int로 변환하였습니다.
음...이렇게 나온 파일을 배열에 저장해서 데이터를 뽑아내야되는데;; 제 생각대로 하니깐 배열이 저장되긴 되는데 하나만 저장되고 계속적으로 그 위에 덮어 씌웁니다..
for(int a=0; a<len-1; a++){
String sOpen = list.get(a).get("bidopen_price").toString();
String sHigh = list.get(a).get("bidhigh_price").toString();
String sLow = list.get(a).get("bidlow_price").toString();
String sClose = list.get(a).get("bidclose_price").toString();
// String[] sOpen = list.get(a).get("bidopen_price").toString().split("\\.");
// String[] sHigh = list.get(a).get("bidhigh_price").toString().split("\\.");
// String[] sLow = list.get(a).get("bidlow_price").toString().split("\\.");
// String[] sClose = list.get(a).get("bidclose_price").toString().split("\\.");
float open = Float.valueOf(sOpen);
int nOpen = (int)(open * 100000);
float high = Float.valueOf(sHigh);
int nHigh = (int)(high * 100000);
float low = Float.valueOf(sLow);
int nLow = (int)(low * 100000);
float close = Float.valueOf(sClose);
int nClose = (int)(close * 100000);
파일을 읽어와서
+-----------+---------+------------+----------------+---------------+---------------+--------------+----------------+-----------------+-----------------+----------------+------------------+-----------------+----------------+
| Member_No | shcode | trade_type | data_time | bidopen_price | bidhigh_price | bidlow_price | bidclose_price | offeropen_price | offerhigh_price | offerlow_price | offerclose_price | Selldeal_volume | Buydeal_volume |
+-----------+---------+------------+----------------+---------------+---------------+--------------+----------------+-----------------+-----------------+----------------+------------------+-----------------+----------------+
| 000 | EUR/JPY | 00 | 20100719080000 | 111.65900 | 111.66700 | 111.63700 | 111.64900 | 111.61900 | 111.62800 | 111.60300 | 111.61200 | 0 | 0 |
텍스트파일이 이렇게 있는데 이 파일을 open, high,low,close 이렇게 뽑아왔습니다. 이데이터를가지고 차트를 그릴건데..실데이터가 소수점으로 나오기때문에 int로 변환하였습니다.
음...이렇게 나온 파일을 배열에 저장해서 데이터를 뽑아내야되는데;; 제 생각대로 하니깐 배열이 저장되긴 되는데 하나만 저장되고 계속적으로 그 위에 덮어 씌웁니다..
nOpen을 차례대로 하나씩 증가 시켜서 할려고 하는데 계속 디버그 걸리네요;
하나씩 증가해서 사용할려고 하는데......도와주세요.