Steem-engine.com: Bugfix and Mobile Optimization

in utopian-io •  4 months ago  (edited)

Pull requests: https://github.com/MattyIce/steem-engine/pull/68
https://github.com/MattyIce/steem-engine/pull/69

Part one of this contribution is a bugfix. The decimal precision of STEEMP was changed from 3 digits to 8. In several places, withdrawing for example, the precision of the STEEM amount in the transaction was still rounded to 3 decimal digits. This caused problems when the amount was rounded up and and exceeded the users balance.

From discord:

image

image

I fixed the rounding so that it always floors the amount.

The second pull request contains some more style improvements for smaller screens.

Before:
image
image
image

After:
se-1
se-2
se-3

And the table on the balances page is now also scrollable.

So now that's it. @beggars is working on the new UI and I'm happy with the current one.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
  ·  4 months ago (edited)

Thank you for your contribution.

  1. using !important may be a code smell. https://css-tricks.com/when-using-important-is-the-right-choice/
  2. it is good to know that .toFixed() has round-up, which reminds me to fix my wallet tool as well. You might unit-tests (or even TDD) this function.
  3. the (3.1).toFixed(3) will return "3.100" but your function will return "3.1"

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

the (3.1).toFixed(3) will return "3.100" but your function will return "3.1"

That's indeed true. Don't tell me that this is a Problem for the APIs... :/

The !important is of course just because all of this will be obsolete one the new UI is ready. So I was just hotfixing. ;)

I think if you are using steem-js, you have to explicitly set 3 decimal places otherwise the API call will fail i.e. that is why I added .toFixed(3) in the first place.

Hmmmm ok. Then this should be fixed asap. I'm now on a plane. So... Maybe you wanna.... :D

Super! This is definitely more robust. But I have to say that I was a bit confused at first because I thought my solution is solid enough. I don't know if there's a possibility for something like 3.1. I only thought about numbers with more than 3 digits.

Thank you for your review, @justyy! Keep up the good work!

Hi @mkt!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @mkt!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!