-
Notifications
You must be signed in to change notification settings - Fork 26
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
Doing math with auto_format: true #154
Comments
a = "3 hdf"
"3 hdf"
>> a*4
NaN So under the line this boils down to the order of operations done on the data. It feels like we should document these orders to avoid this confusion... |
I'd like to fix this problem by grabbing both unformatted and formatted versions and making the unformatted version available for cross-cell math, sorting, footers, etc. The need for unformatted data keeps popping up in issues. Haven't looked at it in detail yet but I will. |
But then the cell in which you did cross-cell math won't be formatted, right? Could the card do the formatting itself (grab the locale from HA and format the data once it's been modified, suffixed and everything)? |
The card can grab both formatted and unformatted values from HA and provide one or the other as appropriate. In the meantime, you can use
The reason this works in this case is:
|
Some cells will be formatted (the ones without math), the others won't.
I tried: It doesn't work at all:
|
Apparently
So, you'll have to convert the comma to a period, and then you would have to reformat it:
It's not pretty, but it works. |
Thank you for spending time on my problem! We're getting somewhere: It's already really good but I'd like to force the number of decimals to 3 on the first column and 2 on the second one. I tried |
As I said, you're not going to get anywhere trying to BTW, I used "fr" to force the locale to French for the example, since my environment is set to "en-US".
|
I’d like column 5 to be column 4 multiplied by 43 (the price of a liter multiplied by the capacity = the price of a full tank).
It works if I don’t use auto_format :
Not with it true:
Just in case, I tried :
I’m sure some of you will tell me it works exactly as expected but I can assure you, as a user (and not a Javascript developer or a computer wizard of some sort), it’s extremely disconcerting. Should I turn auto_format off and then apply a modify: to each column to replace the
.
with a,
and add the unit?The text was updated successfully, but these errors were encountered: