thecsw / memeinvestor_bot

This bot can help you invest in memes and make a fortune out of it!
https://meme.market
GNU General Public License v2.0
135 stars 34 forks source link

Website adds decimal place to displayed balances #203

Closed rickles42 closed 6 years ago

rickles42 commented 6 years ago

The request memes.market/api/investor/rickles42_test returns the following JSON:

{"badges":[],"balance":1000,"broke":0,"completed":0,"name":"rickles42_test","networth":1000}

However, the user profile page for rickles42_test shows:

net worth: 1,000 M¢ balance: 1,000.0 M¢

I see the same behavior on the "Total balances" statistic on index.html.

thecsw commented 6 years ago

Is this a problem?

rickles42 commented 6 years ago

What do you mean? Is this a big problem? No, it's not. But it definitely shouldn't work like this, since MemeCoins can't be fractional. So we should track it as a bug, minor though it may be, and fix it sooner or later.

thecsw commented 6 years ago

I'm so sorry, I just misunderstood what you were saying! Sure, we can get rid of the float division by converting them to integers or casting.

robalb commented 6 years ago

It's not a problem of type conversion (js doesn't have integers btw, only 64 bits IEEE 754 floating point). This problem is caused by a typo in the counter initialization. I'll try to fix it asap

robalb commented 6 years ago

ok, closing this