| | |
| | | map.put("high", realtime.getHigh()); |
| | | map.put("low", realtime.getLow()); |
| | | if( realtime.getVolume() != null){ |
| | | map.put("volume", realtime.getVolume().setScale(2, RoundingMode.HALF_UP)); |
| | | map.put("volume", realtime.getVolume().setScale(2, RoundingMode.DOWN)); |
| | | }else{ |
| | | map.put("volume", realtime.getVolume()); |
| | | } |
| | | if( realtime.getAmount() != null){ |
| | | map.put("amount", realtime.getAmount().setScale(2, RoundingMode.HALF_UP)); |
| | | map.put("amount", realtime.getAmount().setScale(2, RoundingMode.DOWN)); |
| | | }else{ |
| | | map.put("amount", realtime.getAmount()); |
| | | } |
| | |
| | | if (!map.containsKey(key)) { |
| | | map.put(key, stringObjectMap.get(key)); |
| | | BigDecimal open = realtime.getClose(); |
| | | map.put("open", open != null ? open.setScale(decimal, RoundingMode.HALF_UP) : null); |
| | | map.put("open", open != null ? open.setScale(decimal, RoundingMode.DOWN) : null); |
| | | BigDecimal close = realtime.getClose(); |
| | | map.put("close", close != null ? close.setScale(decimal, RoundingMode.HALF_UP) : null); |
| | | map.put("close", close != null ? close.setScale(decimal, RoundingMode.DOWN) : null); |
| | | BigDecimal high = realtime.getHigh(); |
| | | map.put("high", high != null ? high.setScale(decimal, RoundingMode.HALF_UP) : null); |
| | | map.put("high", high != null ? high.setScale(decimal, RoundingMode.DOWN) : null); |
| | | BigDecimal low = realtime.getLow(); |
| | | map.put("low", low != null ? low.setScale(decimal, RoundingMode.HALF_UP) : null); |
| | | map.put("low", low != null ? low.setScale(decimal, RoundingMode.DOWN) : null); |
| | | } |
| | | } |
| | | |