Viewing a response to: @veleje/re-steempytutorials-how-to-calculate-a-post-s-total-rewards-using-steem-python-20180120t194505785z
It's because `Amount` is a class in `steem-python` that splits a string like "10 SBD" into `amount`(10) and `asset` (SBD) as you can see [here](https://github.com/steemit/steem-python/blob/master/steem/amount.py). The `float()` function just converts a number or a string into a float! If you really wanted you could do `recent_claims = float(reward_fund["reward_balance"].split()[0])` instead, but it's easier to just use `Amount` class.
author | amosbastian |
---|---|
permlink | re-veleje-re-steempytutorials-how-to-calculate-a-post-s-total-rewards-using-steem-python-20180120t201201375z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"links":["https://github.com/steemit/steem-python/blob/master/steem/amount.py"],"app":"steemit/0.1"} |
created | 2018-01-20 20:12:00 |
last_update | 2018-01-20 20:13:18 |
depth | 2 |
children | 1 |
last_payout | 2018-01-27 20:12:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.144 HBD |
curator_payout_value | 0.036 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 439 |
author_reputation | 174,473,586,900,705 |
root_title | "Part 9: How To Calculate A Post's Total Rewards Using Steem-Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 30,943,324 |
net_rshares | 16,240,485,077 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
veleje | 0 | 9,632,367,992 | 100% | ||
amosbastian | 0 | 6,608,117,085 | 100% |
I see, thank you! This example here shows better what is going on, nice, now I have two options!
author | veleje |
---|---|
permlink | re-amosbastian-re-veleje-re-steempytutorials-how-to-calculate-a-post-s-total-rewards-using-steem-python-20180120t205125482z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-01-20 20:51:24 |
last_update | 2018-01-20 20:51:24 |
depth | 3 |
children | 0 |
last_payout | 2018-01-27 20:51:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 96 |
author_reputation | 490,220,361,761 |
root_title | "Part 9: How To Calculate A Post's Total Rewards Using Steem-Python" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 30,949,765 |
net_rshares | 0 |