Open mattbryce opened 2 years ago
Hi @mattbryce, looks like a great improvement. I think we should make it a little bit more general. After first look i'm thinking it might be better to pass the json with all config options to Intl.NumberFormat instead of optimizing them for one use case.
Hi @c-klinger, I agree. I'll look at implementing this under my new forked branch... https://github.com/mattbryce/MMM-JsonValue/tree/improvement/value-formatting Thanks
Hi,
I've had the need to format some financial data that my bank returns. The API returns the value in pence, so £250 is returned as "25000" for example.
I've implemented some additional configuration settings and logic whereby it will process the data accordingly. My fork and new branch: https://github.com/mattbryce/MMM-JsonValue/tree/improvement/financial-data
It uses Intl.NumberFormat to format according to the parameters in the config file.
Would be great to merge to main after further testing :)
Thanks