We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
verbose 옵션은 딕셔너리로 서버가 반환하는 값을 그대로 출력해야 한다. get_balance 메서드에서 verbose 옵션으로 리플의 잔고를 조회하는 경우를 살펴 봅시다.
verbose
get_balance
upbit.get_balance(ticker="XRP", verbose=True)
리플을 보유하고 있다면 딕셔너리로 출력되지만 보유하지 않은 경우 0이 반환된다. 내부에서 초기값을 0으로 설정하고 값을 반복문 내부에서 데이터를 채워넣는데, 리플을 보유하고 있지 않아 조건을 충족하지 않으므로 초기값 0이 그대로 반환된다.
balance = 0 for x in balances: if x['currency'] == ticker and x['unit_currency'] == fiat: if verbose is True: balance = x else: balance = float(x['balance']) break
The text was updated successfully, but these errors were encountered:
@brayden-jo 초기화를 이렇게 하면 어떨까요?
if verbose is True: balance = { 'currency': 'KRW', 'balance': '0.0', 'locked': '0.0', 'avg_buy_price': '0', 'avg_buy_price_modified': True, 'unit_currency': 'KRW' } else: balance = 0
Sorry, something went wrong.
mr-yoo
No branches or pull requests
verbose
옵션은 딕셔너리로 서버가 반환하는 값을 그대로 출력해야 한다.get_balance
메서드에서 verbose 옵션으로 리플의 잔고를 조회하는 경우를 살펴 봅시다.리플을 보유하고 있다면 딕셔너리로 출력되지만 보유하지 않은 경우 0이 반환된다. 내부에서 초기값을 0으로 설정하고 값을 반복문 내부에서 데이터를 채워넣는데, 리플을 보유하고 있지 않아 조건을 충족하지 않으므로 초기값 0이 그대로 반환된다.
The text was updated successfully, but these errors were encountered: