mirror of
https://github.com/home-assistant/frontend.git
synced 2026-02-15 07:25:54 +00:00
Add formatEntityStateToParts() + use it for hui-entity-card & ha-state-label-badge (#29239)
* add formatEntityStateToParts * add formatEntityStateToParts * use formatEntityStateToParts * add formatEntityStateToParts * use formatEntityStateToParts * add formatEntityStateToParts * add formatEntityStateToParts * add computeStateDisplayToParts * update for monetary * fix a test for monetary * fixed test for monetary * do not include "order" into result * do not include "order" into result * do not include "order" into result * do not include "order" into result * do not include "order" into result * do not include "order" into result * do not include "order" into result * simplify * ensure less conflicts in future merges * Refactor monetary computing --------- Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
This commit is contained in:
@@ -678,11 +678,11 @@ describe("computeStateDisplayFromEntityAttributes with numeric device classes",
|
||||
"number.test",
|
||||
{
|
||||
device_class: "monetary",
|
||||
unit_of_measurement: "$",
|
||||
unit_of_measurement: "USD",
|
||||
},
|
||||
"12"
|
||||
);
|
||||
expect(result).toBe("12 $");
|
||||
expect(result).toBe("$12.00");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user