jonkan / Electricity-Prices

App displaying the current electricity price, with widgets for Apple Watch, iPhone and iPad
MIT License
19 stars 8 forks source link

Cent formatting #20

Open naltatis opened 4 days ago

naltatis commented 4 days ago

In Germany the common cent notation is '31,6 ct'.

image

jonkan commented 3 days ago

Ah, thanks for pointing this out. Do you know if that should apply to all Euro regions?

naltatis commented 3 days ago

I'm not sure. In our project, I've also done some international electricity price formatting. I also had to do some internet searching and rolled my own currency-specific formatting logic, which may not always correct.

https://github.com/evcc-io/evcc/blob/master/assets/js/mixins/formatter.js#L2-L15

https://github.com/evcc-io/evcc/blob/master/assets/js/mixins/formatter.js#L288

jonkan commented 13 hours ago

Alright! Ok, so I found this source: https://european-union.europa.eu/document/download/b9fdeae1-dc66-47a7-a902-fb941309e744_hr?filename=publication6336_en.pdf

There is no official abbreviation for “cent”, but one could reflect on using either “c” or “ct”.

But I'll totally take your word for it and just change to ct. Thank you for helping me improve the app :)

naltatis commented 12 hours ago

Interesting. c is extremely uncommon, at least here in Germany 😀