ha_nicehash icon indicating copy to clipboard operation
ha_nicehash copied to clipboard

Not really an issue - decimal places

Open BassBoi opened this issue 5 years ago • 4 comments

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

BassBoi avatar Mar 05 '21 16:03 BassBoi

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

RomRider avatar Mar 06 '21 08:03 RomRider

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 :)

Kryzek avatar Mar 09 '21 11:03 Kryzek

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

image

irekzielinski avatar Jan 04 '22 20:01 irekzielinski

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

Abruzzi04 avatar May 04 '22 12:05 Abruzzi04