Skip to content
New issue

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

Not really an issue - decimal places #7

Open
BassBoi opened this issue Mar 5, 2021 · 4 comments
Open

Not really an issue - decimal places #7

BassBoi opened this issue Mar 5, 2021 · 4 comments

Comments

@BassBoi
Copy link

BassBoi commented Mar 5, 2021

Very good integration!
is there a simple way to limit the amount of decimal places?
for example my hashrate is 61.125465859008465 MH/s.
Sorry if dumb question

@RomRider
Copy link
Owner

RomRider commented Mar 6, 2021

There should be a way with a template sensor but for now, not natively with the integration 😊

@Kryzek
Copy link

Kryzek commented Mar 9, 2021

I used https://github.com/thomasloven/lovelace-template-entity-row for formatting and my entity-card is something like:

entities:
  - type: 'custom:template-entity-row'
    icon: 'mdi:currency-eur'
    name: BTC Balance Unpaid / Paid
    state: >-
      {{ (states('sensor.nh_nicehash_unpaidamount_eur')| float |round(2)) }}€ /
      {{ (states('sensor.nh_nicehash_totalbalance_eur')| float |round(2)) }}€

Which turns into:
image

Hope this helps and gives you the ideas to approach this :)

@irekzielinski
Copy link

I modified sensor.py to round most of the rig values to 2 decimal places:

image

@Abruzzi04
Copy link

I modified sensor.py to round most of the rig values to 2 decimal places:

image

Captura de ecrã 2022-05-04 130451

Hello.
This solution didn't work for me :s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants