I found countless posts on how to round to 1/2/3/n decimal places with different solutions.
round(n) is by far the most suggested/utilized by the member of this community, including me. Unfortunately this solution technically works fine but I’d like to see 0’s instead of blank space in the lovelace.
Looks like we’ve got to wait for the lovelace to be able to understand that a given value is monetary (device_class: monetary) and visualize it in the correct way.
It’s because of how the “native types” feature works (explained in the linked post). If the template’s output looks like a floating point number, it is handled as a floating point number. So the string ‘1.2000’ becomes 1.2 because there’s no need to represent a floating point number with trailing zeros.
However, if you include a non-numeric character in the string then the “native types” feature cannot interpret it as an integer or floating point number so it’s handled as a string.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been solved (the workaround was explained). It will help users find answers to similar questions. For more information refer to guideline 21 in the FAQ.