it just takes the string and counts from the beginning [:x] numbers into the string and displays that.
ie “Password” is our string
[:4] would display “Pass” while on the flipside [4:] would display “word”
so for the OP’s need it takes a long number ie “240.4334324234” and splits it at the “.” which gives us “240” and “4334324234” so we take the 2nd part and just get the first number because the longer one isn’t needed. [:1]
'%.2f' means a float is getting plopped there and it will have 2 numbers after the decimal place. You can place a number before like this '%2.2f' and it will only have 2 numbers before and 2 numbers after. You need to pass this as a float, not a string which is why the pipe float filter is there.
EDIT and lastly, if the history graph isn’t showing up properly, you may need to convert it back into a float (because format turns it into a string)
I know I revived an old post but this is similar to my case but I don’t know where to edit this file mentioned in this thread. Is it on Configuration.yaml or somewhere else?